0
votes
1answer
24 views

Sorting by meta_key different to search criteria?

I've created an admin only page simply to view more information about subscribers to my website. The subscriptions are stored as Custom Post Types. All I want to do is make a condition that looks up ...
0
votes
1answer
89 views

WP_query - Filter by tax_query and meta_query using multiple select

I have a Publications Post Type, a Writers Taxonomy and a Publications Custom 'Meta Box' Value; parent_id. In my archive-publictions-post.php template I am trying to filter the WP_Query Class, with ...
0
votes
0answers
39 views

Custom Post Type: Event - Display Upcoming Events for Next 30 Days

I need to display the upcoming events for next 30 Days and sort the same based on custom date field. Below is the code I am using right now but not got any success in hiding old Events and ...
1
vote
2answers
43 views

Query that joins the postmeta table twice

I believe what I'm trying to do is too complex for the standard meta_query parameter in get_posts, so I'm trying to use a custom SQL query to do the following: I have a game custom post that has ...
0
votes
0answers
251 views

Displaying Metabox value (custom post type taxonomy)

I have been stuck on this for days, reading articles and articles and nothing works. I am trying to display the value of my metabox on a template page. I successfully added the metabox, and I see ...
1
vote
0answers
51 views

Configuring a meta query with multiple post types that have the same relationship on a single page

I am creating a client portal were my clients can maintain their projects and leave feedback. I have two custom post types called "Clients" and "Projects" and they each pull information from one ...
0
votes
0answers
65 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 ...
1
vote
1answer
62 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.. ...
0
votes
1answer
195 views

Using WP meta query to show custom post types by a start and finish date

I have a custom post type called 'events', I have a page which displays events by each month. Each event has a start_date and finish_date custom field (using advanced custom fields plugin) which ...
0
votes
1answer
58 views

Two queries – one with checkbox ticked, one without – comparing meta_query

I am trying to do the following: Two queries 1. Get all people that have director 'yes' ticked 2. Get all people that don't have director 'yes' ticked I have the first query all set up and works ...
2
votes
2answers
120 views

CPT Meta Searching

I'm developing a WP plugin which uses custom post types and meta data. What I'm trying to achieve is having the meta data searchable. Here is some code that I found which searches the meta data fine, ...
2
votes
1answer
230 views

Order Posts by Taxonomy and Meta Value

It's possible to order posts by Meta Value. It's possible to order posts by more than one value. And thanks to the code below it's possible to order by taxonomy. But how can I alter the code below ...
0
votes
3answers
523 views

Custom Query With Multiple Meta Key Value

I am new with WordPress development and I have found this query and I want pass multiple key and value in this query. My Query is: $querydetails = " SELECT wposts.* FROM $wpdb->posts ...
0
votes
2answers
46 views

Is it possible to load a different sidebar in single.php based on a meta_query filter?

I have a custom post type 'speakers' and I have a checkbox custom field (meta_query) to separate my Conference speakers from my Workshop speakers. I can filter my speakers with this meta_query and ...
8
votes
1answer
225 views

Mixing regular and custom post types (with meta_query) on home page

Not sure how to achieve this. I'm trying to mix standard posts and custom posts on a site homepage but I only want to display the custom posts if a meta value is set. Displaying the posts works fine ...
0
votes
1answer
156 views

Filtering custom post type on a combination of custom taxonomies and custom fields?

I have a custom post type "artist". It has an associated custom taxonomy "artist_type" with terms "voice", "actor", "corporate" An "artist" also has custom fields for gender, location, agerangefrom ...
0
votes
0answers
97 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
1answer
46 views

using post_type with meta_query

I'm setting up a basic slideshow and want to loop through the custom post type “Projects” and display only projects with a photo attached - <ul class="slides"> <?php $args = array( ...
0
votes
1answer
180 views

Can't sort order of wp_query with 2 meta keys

I'm trying to display custom post types by excluding the sold ones but also by displaying them in alphabetical order from the county meta_key. I'm trying to use pre_get_posts but I'm not sure that ...
0
votes
1answer
947 views

exclude custom post type by meta key in wp_query

I'm trying to display a custom post type (properties) and exclude posts that have a certain meta value (sold). Is there a way that I can do this? I have this for my code so far: ...
1
vote
0answers
88 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. ...
0
votes
1answer
103 views

Ordering by multiple meta keys - Custom post type

I've searched the web to try and do this but none of the examples quite resemble the way my data is currently laid out, I wonder if someone can tell me how to tailor it to my setup? This is the way ...
2
votes
2answers
917 views

Custom query variable - get wordpress to redirect to nice permalink url

I have been looking for an answer for the last couple of hours but could not find anything pointing me in the right direction. Some advice would be very much appreciated! What I already have: A ...
0
votes
1answer
433 views

Query based on custom fields start and end date

I have a custom post type called Events, with 2 custom fields, start date and end date. These fields are stored using a timestamp in the database. I want to create a custom query based on these 2 ...
1
vote
1answer
88 views

Get posts between custom dates

I created an event CPT and a meta box with a date. I saved the date as post_meta in the form dd.mm.yyyy. Now I want to create a shortcode that queries all posts which's dates meet the condition ...
0
votes
0answers
189 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(); ...
1
vote
1answer
230 views

Query for custom post type objects in a taxonomy and with a meta value

I want fetch all posts from the post type book in the custom taxonomy book_tags with the meta key lang and the meta value en. My code: <?php $args = array( 'post_type' => 'book', ...
1
vote
2answers
3k views

Get posts based on meta key/value

I have a custom post type "custom_author" which is selected when making a new post using a metabox dropdown with field key "chosen_author". This is what my wp_postmeta looks like: Where 13088 is ...
0
votes
1answer
879 views

filter search result with custom post type meta key

The default search returns all post types, which is what I want. But for one specific custom post type I want to limit the result to a specific meta key value (a custom date that must be greater than ...
0
votes
1answer
780 views

Filtering a WP_Query meta_query by numeric values isn't working

That was a very dense title. I have a custom post type "event" which has a Date/Time picker field "event_date" thanks to the Advanced Custom Fields plugin. This Date/Time picker saves a UNIX ...
0
votes
1answer
37 views

Filtering problem

I got the custom_post_type_data in which I store some variables when I make a new post. Variables likes Author, Price etc. I implemented a filtering by author, so when you click on James (for ...
2
votes
1answer
261 views

order by meta_value serialized array

Hi I'm trying to pull posts using the wp query. Just one problem--I am trying to sort the posts alphabetically by a certain meta_value. Thing is that this meta_value is a serialized array. Is there an ...
0
votes
1answer
325 views

WP_Query arguments: Loop through custom post type - get all entries except excluded meta_key?

Can't seem to find out what I'm doing wrong. $args = array( 'post_type' => 'wr_event', // my custom post type 'posts_per_page' => -1, // show all posts 'meta_query' => array( ...
0
votes
1answer
174 views

loop through custom post-type with two meta_keys

I have a custom-post-type named my_project. This post-type has two meta-boxes: is_featured is_featured_position So essentially in my backend of the post-type I can set a checkbox for is_featured ...
1
vote
1answer
171 views

query order by date on custom type: wrong order

I know there are very similar questions ans answers out there already, but I simply cannot get my query to get into the right order. I have a custom post type ("bb_articles") with custom fields, ...
1
vote
1answer
303 views

Filter posts with meta_query NOT IN where value has multiple values

I would like to use a meta_key to store multiple values in that key. Thereafter, I would like to filter away posts that do not contain a specific value in the key. In other words, just show posts ...
0
votes
1answer
158 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] ...
2
votes
1answer
581 views

WP_Query() show posts that end later than today

I have a query as follows: $wp_query = new WP_Query( 'meta_key' => 'end_date', 'meta_value' => 'today', 'meta_compare' => '>=', 'post_type' => 'vehicle' ); ...
1
vote
0answers
444 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, ...
1
vote
2answers
1k views

Using Query Posts With Multiple Post Types And A Taxonomy

I am developing a site that has two different custom post types; one of them is called Articles and one is called Sketchpad. Sketchpad is user submitted content that is assigned a custom taxonomy term ...
2
votes
1answer
397 views

Meta_query with relation 'OR' killing server CPU

function get_nb_offres( $typeOffre ) { global $type_bien_correspondances; $args = array( 'post_type' => 'annonces', 'meta_query' => array( 'relation' => ...
0
votes
1answer
883 views

filter custom post type by meta key in dashboard

I'm looking for a way to expand e customize more this topic how to filter post listing (in WP dashboard posts listing) using a custom field (search functionnality)? I've a custom post type in the ...
1
vote
1answer
45 views

How to let users choose where to search for posts?

I have no code to let you correct/see, I'm still in 'thinking stage'. What i would like to achieve is this: A real estate website with a few search functionalities. This new agency (REALLY NEW we have ...
0
votes
2answers
115 views

Getting a custom post's custom field based on another custom post's custom field select

So I'm at my wit's end here. I've done this before plenty of times, but I think I have stared at this so much I am missing something. I basically have a custom post called locations. That custom ...
1
vote
1answer
498 views

Filtering by Post Meta Custom Fields - Performance

I could use some advise on how to structure my data for performance. I have a custom post type with a lot of custom meta data stored in the wp_postmeta table as a serialized array under one meta key ...
0
votes
2answers
450 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 ...
3
votes
1answer
2k views

Querying custom post type with 2 custom fields (date-range)

I've searched WP Codex and StackExchange and gotten some clues, but I can't get this query working. I have 2 custom fields associated with each exhibition in Y-m-d format: exstart-date being the start ...
1
vote
1answer
332 views

Pull a post based on a meta value in a custom post type

I'm trying to display a post, from a custom post type based on a meta value in that post type, in this case a checkbox that says "if this is checked show it on the front page. Usually I write a ...
0
votes
1answer
210 views

Querying multiple values from a single key

Bainternet assisted me earler with the relation AND parameter. What I need to do now is determine how to query multiple vales from a single key. If I try to specify two arrays with the same key the ...
4
votes
4answers
3k views

meta_query for keys that aren't yet set

I'm trying to query for a custom post type for a gallery system. I have a checkbox to set a gallery as a "featured" gallery (set up through More Fields plugin) - if this is checked then the meta value ...