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

2
votes
1answer
17 views

wordpress custom_meta ordering of timestamps

So I have a wp meta query that is handling the searching of events which have a start timestamp, and an end timestamp, I want to return all results within the two dates a user picks in the search. ...
2
votes
1answer
61 views

XOR functionality for meta_query

I'm trying to resolve the problem with event displaying. An event has its start and end dates, written in meta. For example, event starts on (dmY) 03.04.2013 and ends up on 08.04.2013. Using WP_query ...
1
vote
1answer
41 views

How to Output which matched meta_keys were found from custom_type_posts?

In WordPress on the single-player.php page which displays a single profile (from numerous other profiles) with information from around 10 different meta fields. Without using tags or categories.. ...
1
vote
1answer
26 views

Permalink structure with $_SESSION variables

I have a project that has content being filtered throughout the site (many custom WP_QUERY calls). Originally there was no URL needs, just filtering by $_SESSION variable. Works perfectly, but NOW ...
1
vote
1answer
266 views

How do I create my own nested meta_query using posts_where / posts_join?

Some of my posts (not all) have a price as a meta key/value. Today I use the pre_get_posts action so that my users can search for prices that are between a certain value. This is the code that I'm ...
1
vote
1answer
346 views

Query by meta_key and order by meta_value_num return orderby date

I'm trying to use the orderby and custom WP_Query features of wordpress. It works nicely to select item by their meta and to order by date. Unfortunately, it seems that I could not get the post ...
1
vote
1answer
125 views

Change order of posts

I made a post recently that did not explained myself right! Come again, but with better explanations. I need the "Select Option" change the order of query_posts. My current code is: <select> ...
1
vote
1answer
122 views

Filter posts by meta query?

I made custom post type and used a meta query … For this link: ...
1
vote
1answer
775 views

search query within custom taxonomy term, post title and meta field

I want to create a search that does: Search within my custom taxonomy - custom-tags search the post title search select meta field ?? dont know search with custom post type - easy part I looked ...
0
votes
1answer
34 views

Very slow query with meta_query on large database

I have a blog with about 200k posts and each one have 20 custom fields. I've been using WordPress Transients_API to cache queries, in the few cases where it can be used, but it can't be used in some ...
0
votes
1answer
69 views

Query by radio button ACF

I am making a page template that should display custom post-types that have meta value that matches the page title. Meta value is added trough Advanced Custom Field radio buttons, but the query is not ...
0
votes
1answer
32 views

query post based on comparison

Each post in my site can be rated as 'good' , 'ok' , 'bad'. The values are stored in custom fields. I now need to show top 10 posts with maximum 'good' and it should not display posts with greater ...
0
votes
1answer
67 views

Matching Serialized Arrays with meta_query

I've asked a related question previously, but I think I've finally worked out the crux of my issue. I'm using Advanced Custom Fields and have a number of custom fields attached to my post type. I'm ...
0
votes
1answer
300 views

How to create/modfiy WP_Query to search in post title OR custom field?

I need to modify or create a WP_Query that will search for a search term in both the post title OR a custom field (called 'my_field'). I have been reading and trying for hours, but I am right back to ...
2
votes
0answers
95 views

Is it possible to orderby multiple meta_keys when using meta_value_num?

Reading through the order & orderby documentation, it's not clear to me whether there is any support to order based on multiple meta_key values. Obviously, using meta_query I can return posts ...
2
votes
0answers
228 views

Trying to perform complex custom field query with order by set to field value

I've got two custom fields for event posts: event-start and event-end. When I'm querying for current events, I'd like to show any post where the event-start OR the event-end is greater than or equal ...
1
vote
0answers
15 views

2 weeks ago from meta query meta value

This is my meta query within my posts query. 'meta_query' => array( array( 'key' => 'rw_membership_ends', 'value' => ??????? ...
1
vote
0answers
73 views

WP_Query with meta_query dosen't return results

I am trying to get list of posts filtered by fields I added using the advance custom fields plugin. I have more fields that I want to use but it doesn't work as I want it to. Here is what the query ...
1
vote
0answers
79 views

Possible to filter custom post type with multiple meta data?

I'm wondering if it's possible in one loop to accomplish what I need to do. What I would like is to sort all custom post types by the meta data of county and put them in order which it is doing here. ...
1
vote
0answers
59 views

database query with more than a couple meta hangs and doesn't complete

I have a development website with about 70 checkboxes for custom fields. The idea is the user selects one or more checkboxes, it queries the database for all posts that have a meta_key for the ...
1
vote
0answers
67 views

Meta Query And/Or

My question is very similar to Meta Query with AND & OR? . This question was answered in 2011 by @Otto. With the exception that my logic is different. I want to query, for example, posts with ...
1
vote
0answers
108 views

Pre Get Posts / Multiple Meta Keys / Orderby Single Key

Tried more than a few variances to enable my pre_get_posts callback function to display posts that possess one, or both, of 2 separate meta_keys, upon display to then orderby a single meta_key. Here ...
1
vote
0answers
272 views

How to filter a query by multiple meta keys and order by other meta keys

I'm trying to query posts using WP_Query and meta_query parameters: $args = array( 'post_type' => 'produkty', 'meta_query' => array( 'relation' => 'AND', array( ...
1
vote
0answers
313 views

Meta query with multiple custom fields for archives page ordering problem

I'm modifying the query for archives pages so that the posts showing up on year, month or day pages are queried by there custom field (start-date and end-date) and are sorted by custom star-date ...
1
vote
0answers
333 views

filter custom field values $min $max

The user needs to query posts by entering a $minPrice, $maxPrice and a category value. Here is my query which returns no results: function result() { $result = array( 'cat' => ...
1
vote
0answers
403 views

filter search custom field query

I'm looking for way to filter search results. This is what I have so far a custom post type of "doctors" in each "doctor" post, there are numerous custom fields (male or female, location, ...
0
votes
0answers
35 views

Add custom fields meta_query to wordpress search function

I'm trying to extend the wordpress search function to include custom fields using the pre_get_posts filter: function test_custom_search_query( $query ) { $adv_custom_fields = array( 'field_1', ...
0
votes
0answers
37 views

Ordering custom post type by multiple custom fields

I was wondering if you'd be able to help with an issue i'm having? I have implemented a fix that you came up with in this post: How to order custom post type by multiple custom fields? however when I ...
0
votes
0answers
31 views

meta_query compare not working

I'm trying to run this WP_Query on tag.php, and it doesn't seem to work. $tag = get_query_var('tag'); $args = array ( 'tag' => $tag, ...
0
votes
0answers
22 views

Sort posts in dashboard using custom field; also include posts where field isn't set

I'm using a pre_get_posts filter found on this question thread here, to sort a custom post type in the dashboard: function xyz_event_sort_order( $wp_query ) { if ( is_admin() ) { ...
0
votes
0answers
32 views

Orderby custom date fields with meta_query broken on OR relation

I have an 'event' post type that has custom start and end date fields. In a block on the home page, I'm trying to show only upcoming or ongoing events. So, to achieve this, I'm doing a meta_query that ...
0
votes
0answers
8 views

meta_query works with single query but not multiple queries

This is very strange and I'm not sure why it is happening but this piece of code... $args = array( 'post_type' => 'property', 'sentance' => true, 'meta_query' => ...
0
votes
0answers
40 views

Multiple metadata checkbox sorting

I'm searching for a while but cannot figure how to do exactly... I want sorting my custom post type posts with multiple checkboxes metadata in front-end of an archive page. All store in a session. ...
0
votes
0answers
23 views

Wordpress Query Default Order if Meta Values Same?

If the main query args look like this: 'orderby' => 'meta_value_num', 'meta_key' => 'price', 'order' => 'DESC' What orderby does the query use if the meta_key value is the same for ...
0
votes
0answers
67 views

Query Posts Via WordPress URL

I wanted to learn more about querying post types and their custom fields in WordPress. I've got two questions... I've followed this tutorial on Advanced Custom Fields and am trying to understand what ...
0
votes
0answers
64 views

Unable to use meta_query between currency values when value is over 1 million

I am trying to add a meta_query that searches for values of the field price that are between two different values. As long as the values stay below $1 million it works great. However, as soon as one ...
0
votes
0answers
33 views

Advanced meta query help

I want to get posts according to the following logic: "If post status = publish or pending then get all records which have a meta value of less than todays date. If the post is in trash, get it ...
0
votes
0answers
61 views

Meta_query weird behaviour

I have a custom field called date_from. Dates are stored in the yymmdd format (eg 20131104). When I use a meta_query to find posts in a specific date range the query works as expected, but when I use ...
0
votes
0answers
88 views

Why is WP_Query's meta_query not filtering results?

I am working on a wordpress site that utilizes WP_Query to find songs based on their category, tags, and other things in a tax_query, but it also groups in a meta_query which (should) find songs based ...
0
votes
0answers
28 views

How to create a link for wordpress meta datas?

I would like to create a link for "Leave a comment", which name "quick comment" (here come a ajax comment form on div). How can I do this? I have attached a picture where I'd like to put this link: ...
0
votes
0answers
78 views

Trying to combine multiple Wordpress queries

I am trying to query multiple post types and meta values in Wordpress... the query is trying to fetch event post types with a featured meta key, as well as post post types with the featured image set. ...
0
votes
0answers
57 views

Meta query “OR” comparison not working as expected with array

I have this code to get cars that have color 1 or 0 ( stored in db in rw_color as 1 for white and 0 is black): $args_search = array( 'post_type' => array( 'cars' ), ...
0
votes
0answers
88 views

latitude/longitude meta_query

I've been trying to figure out a way to do radius search in WP and decided upon a simpler way than big queries, I'm having problems returning results though I've got a function called ...
0
votes
0answers
18 views

Query posts than have a lapse of time active

First of all, sorry guys for my poor english. OK, i wanna make a query for show posts that doesn´t passed 3 days from it publication. I set a field for the expire date when it´s published (the time is ...
0
votes
0answers
72 views

Order custom posts by meta_value_num then date

I'm trying to order custom posts by meta_value_num then date using the following query: $args = array( 'posts_per_page' => '-1', 'post_type' => ...
0
votes
0answers
222 views

Using a query to display custom post types based on ACF post_object

Basically the set up I currently have is two sets of custom post types which are: uc_university and uc_course I'm having lots of trouble trying to display a course based on a my Advanced Custom ...
0
votes
0answers
183 views

Adding meta query search filter that works with taxonomy filters

TL:DR How do I specify a dynamic meta value for search queries? I have [this archive page] that allows to do search within filtered taxonomies 1: <?php $term = $wp_query->get_queried_object(); ...
0
votes
0answers
31 views

Plugin for taxonomy nested-set descriptors?

I'm trying out the Ultimate Taxonomy Manager plugin, and I would like to run "cascading" queries against taxonomy metadata. For example, I'm defining ad unit IDs that can be overridden on a ...
0
votes
0answers
88 views

how to pull and display field data into a users back office in a members environment using affiliate plugin

I am using two plugins which work well together. In fact one is s2memeber so I can have a members area, the other is called affiliate pro so I can use referrals to fill up the members area. However, I ...
0
votes
0answers
105 views

Search with meta_query and tax_query

I'm working on a little database for series based on wordpress. I've implemented a custom post type called "anime", some taxonomies (Genre, a_types..) and a lof of customfields. (based on acf). Now ...