Author:
erics, October 13th, 2020
The first query gets all custom publication posts that have a value in field book_seq ordered by book_seq The second query gets all custom publication posts that have no meta value for book_seq or no meta record for key book_seq ordered by post_title.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
$querytop = get_posts(array( 'post_type' => 'publication', 'numberposts' => -1, 'orderby' => 'meta_value', 'meta_key' => 'book_seq', 'order' => 'ASC', 'meta_query' => array( // meta query takes an array of arrays, watch out for this! array( 'key' => 'book_seq', 'value' => array('', 'NULL'), 'compare' => 'NOT IN' ) ) )); $querybottom = get_posts(array( 'post_type' => 'publication', 'numberposts' => -1, 'orderby' => 'post_title', 'order' => 'ASC', 'meta_query' => array( // meta query takes an array of arrays, watch out for this! 'relation' => 'OR', array( 'key' => 'book_seq', 'compare' => 'NOT EXISTS' ), array( 'key' => 'book_seq', 'value' => array('', 'NULL'), 'compare' => 'IN' ) ) )); $store_query = array_merge($querytop, $querybottom); |
Great article here: https://rudrastyh.com/wordpress/meta_query.html
Categories: How-To's, Technology Tags: get_posts, meta_query, Or, php, Query, search, Store, WordPress
|
No comments
Author:
erics, March 23rd, 2020
Using PERL, we can easily do a search and replace across multiple files. perl -ni -w -e ‘print unless m/^gdb\d+/;’ yourFileSpec
Categories: How-To's, Technology Tags: Batch, Delete, Edit, Edit In Place, howto, in place, perl, search, tips
|
No comments
Author:
erics, February 7th, 2020
|
git log --pickaxe-regex -p --color-words -S "theSearchString" |
Categories: How-To's, Technology Tags: Color, color-words, git, grep, howto, Log, Pickaxe, search, tips
|
No comments
Author:
erics, September 5th, 2017
Set browser.autofocus to false in about:config
Categories: How-To's, Technology Tags: about:config, AutoFocus, Browser, browser.autofocus, Config, configure, Firefox, Focus, New Tab, search, Tab, URL
|
No comments
Author:
erics, July 7th, 2015
To search for non-ASCII characters: /[^\d0-\d127] Use the substitute function to clean them up: :%s/[^\d0-\d127]/ /g
Categories: How-To's, Technology Tags: ASCII, Char, Characters, Find, howto, Replace, search, tips, vi, vim
|
No comments
Author:
erics, October 16th, 2014
Using PERL, we can easily do a search and replace across multiple files. perl -pi -w -e ‘s/SEARCH_FOR/REPLACE_WITH/g;’ FILE_LIST The following example will replace all occurrences of “hello” with “goodbye” inside files ending with .txt:
|
perl -pi -w -e 's/hello/goodbye/g;' *.txt |
To handle special characters, use the hex value. For example, to convert MS web files that use control characters: […]
Categories: How-To's, Technology Tags: Batch, howto, perl, Replace, search, tips
|
No comments
Author:
erics, November 25th, 2009
sudo mdutil -E -i on / or You need to get Spotlight to reindex the mail folder (Home/Library/Mail), but you don’t have to mess about in terminal. From the Apple menu, choose System Preferences. Click Spotlight. Click the Privacy tab. Drag the folder to the list. Remove the item or volume you just added. ~or~ […]
Categories: How-To's, Technology Tags: howto, mail, reindex, search
|
No comments
Author:
erics, September 29th, 2009
To ignore case in the searches, enter the following command: :set ignorecase This command can be abbreviated as: :set ic To turn off this feature, use: :set noignorecase This command can be abbreviated as: :set noic
Categories: How-To's, Technology Tags: Case, howto, ic, ignore, ignore case, ignorecase, noic, noignorecase, search, set, tips, vim
|
No comments