Refers to a mechanism built into the WP_Query class for querying the database for post data, including pages and CPTs, based upon post meta data.

learn more… | top users | synonyms

0
votes
1answer
137 views

Querying meta values within an array

Okay so I'm using the relationship field from Advanced Custom Fields against a custom post type. The relationship lists countries, when these are saved they are within a serialised array: [country] ...
0
votes
3answers
85 views

Creating Custom Query

I've hit some sort of stumbling bock here, and I can't find my way over it. I'm trying to craft a custom WP query that searches for posts by country of origin, selecting multiple countries at once. ...
0
votes
1answer
336 views

WP_Query orderby meta key/value suddely stopped working

I have code that has been working for a long time which when a user clicks a button to order database results by name/value, it gets the results via AJAX from a page that does all the querying. I ...
0
votes
1answer
581 views

Difference between 'LIKE' and 'IN' in meta queries

You can use a variety of different comparison operators in meta queries, among which are 'LIKE', 'NOT LIKE', 'IN', and 'NOT IN'. What is the difference in use between LIKE and IN? Here's the ...
0
votes
2answers
425 views

Custom Post Type + Custom Meta Query Not Showing 2012 Posts

I created a custom "events" post type for a client that basically "hides" the post once it has expired (ie. the event already happened). The events are displayed in the order of the start date rather ...
0
votes
2answers
271 views

meta_query and strange orderby behaviour

this is my problem query, which picks all future or pending events. Note that some posts only have _startdate without _enddate (1-day events). $args = array( 'post_type'=> 'events', 'meta_query' ...
0
votes
2answers
162 views

order by meta_key [duplicate]

i have a little problem: I can not order my events as i wish. I would like to order my upcoming events in ascending order... I am using the following: new WP_Query( array( 'author' ...
-1
votes
1answer
52 views

Wp query by 2 meta field - check if they exists / have value

I am looking for the shortest most resrouce affective (not mysql query) to count the amount of posts that have 2 meta keys <-- if they exists i found this simple way at the codex but it checks for ...
-1
votes
1answer
98 views

294 Queries on Mainpage of Wordpress

I have 294 queries on my wordpress site. I checked using sql monitorand the maximum queries are to display count of a cities list custom field. Lets say there are 200 cities then 200 queries are ...
-2
votes
1answer
453 views

Too many if's and else if's ?? - Must be better way [closed]

Everyone on this forum has helped me tremendously. Thank you. I now have a page that functions the way I want it but my code seems to be cumbersome. To figure out a string to echo I have a long ...
-2
votes
1answer
134 views

Get all user with both meta_value

I was wondering if there were any efficient way of fetching all user comparing two different meta_key. I am currently fetching all user compared to the first meta, then loop trough the user_id to ...