‘relevance‘ – Order by search terms in the following order: First, whether the entire sentence is matched. Second, if all the search terms are within the titles. Third, if any of the search terms appear in the titles. And, fourth, if the full sentence appears in the contents.
‘menu_order‘ – Order by Page Order. Used most often for Pages (Order field in the Edit Page Attributes box) and for Attachments (the integer fields in the Insert / Upload Media Gallery dialog), but could be used for any post type with distinct ‘menu_order‘ values (they all default to 0).
‘meta_value‘ – Note that a ‘meta_key=keyname‘ must also be present in the query. Note also that the sorting will be alphabetical which is fine for strings (i.e. words), but can be unexpected for numbers (e.g. 1, 3, 34, 4, 56, 6, etc, rather than 1, 3, 4, 6, 34, 56 as you might naturally expect). Use ‘meta_value_num‘ instead for numeric values.
‘meta_value_num‘ – Order by numeric meta value . Also, note that a ‘meta_key=keyname‘ must also be present in the query. This value allows for numerical sorting as noted above in ‘meta_value‘.
Select the Tag term
Show posts with specific tags. Supports multiple tags
Exclude Tag Term
Exclude any tag that’s not required. Supports multiple tags
Select the Category term
Show posts with specific Category. Supports multiple Categories
Exclude Tag Term
Exclude any Category that’s not required. Supports multiple Categories.
Enable the Tax query
Enables the taxonomy module
Say if you want to display post form a category bird also with category animal. This tool comes in handy. This also allows choosing custom taxonomy as well!. Say if you want to include posts with tag insects. Just select the “OR” relation and with repeater field select the tag and category. It’s that easy.
“AND”- Should satisfy both conditions: the post should have category animal and tag wild
“OR” – Should satisfy any of the conditions: the post should have category animal or tag wild
If you made a custom taxonomy then it can be used as well. Disable the tax Query if you don’t want it.
2019-06-27T16:21:40+05:30June 27th, 2019|Comments Off on Type Ordering and Filtering