Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 154460

"wp-query" ambiguously refers to one of two things. 1) WP_Query is a class native to WordPress which allows users to query the posts database using a number of criteria. 2) $wp_query is the global variable that holds the main query object prepared by WordPress based on a given request.

1 vote

wp_query get data from advanced custom field in wordpress

ACF plugin stores data in the wp_postmeta like the default WordPress custom fields. To get data from a custom field your code should look like this (assuming the custom field name is "brand_name"). …
Greg Winiarski's user avatar
1 vote
Accepted

How to sort a WP_Query by a custom field AND ALSO filter by a different custom field

to sort the posts by a meta field you need to have this field in meta_query and in orderby like this $query_args = array( 'post_type' => 'MY_POSTTYPE_NAME', 'post_per_page' => -1, 'meta_query' …
Greg Winiarski's user avatar
1 vote
Accepted

WP Query - Posts Per Page not working in combination with category__in

i am testing your code on my dev site and it returns only 1 result (although there are 3 items in the same category), so your code seems to be fine, maybe there is some other filter applied which igno …
Greg Winiarski's user avatar