Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
64 views

tax_query showing no results

I'm creating a music database site with two custom post types: tracks and albums. I've linked the tracks to their respective albums with a custom taxonomy for the album's slug. On each album page, I'm ...
0
votes
1answer
28 views

Include Category With Tax Query

I'm using The Events Calendar plugin but I thought I'd post it here as I believe this particular function works the same as get_posts(). I'm trying to use the function to display only posts from one ...
0
votes
0answers
84 views

Display related posts with same category or same tag return blank

I'm trying to display 4 related posted in the same category or have the same tag with the current post on the single post page. The result is just blank. <?php $rCateogry = ...
1
vote
0answers
30 views

Wordpress tax_query not showing private posts

When querying posts with the following: $getClientsArgs = array( 'post_type' => 'client', 'showposts' => -1 ); query_posts($getClientsArgs); Private posts are displayed if the person ...
0
votes
1answer
63 views

Match two taxonomies to display a specific content

I have a page divided in two bars. The left bar is a side menu, which shows contents for a specific country (ie: if I am in the Mexico page, there are options listing Cancun, Acapulco, Mexico ...
0
votes
1answer
446 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
1answer
52 views

Get the tax term in which is a post via wp_query

I'll rewrite my original question because I feel like I can't be understood : I made a template page on which I have different WP_Query. I have a category taxonomy (countries). This template page ...
0
votes
0answers
29 views

Wordpress hiding posts without content on custom taxonomy query. How to solve?

I have a custom taxonomy query for a custom post type with the following code: $args = array( 'post-type' => 'network-partners', 'posts_per_page' => -1, array( array( ...
0
votes
1answer
210 views

WP_Tax_Query with post_tag not working

Using the pre_get_posts hook, I'm trying to allow users to narrow down their search by limiting it to posts with certain (multiple) tags applied. This is my hook and function: ...
-1
votes
1answer
86 views

WP_Query with tax_query not working

I tried to create a custom query, but no results, it throws me an error. $args = array( 'post_type' => 'product', 'posts_per_page' => 1, ...
0
votes
0answers
42 views

Tax Query With Meta Query

I'm tring to using tax_query and meta_query in taxonomy-term.php I want to sort list by date custom field. Taxonomy name is sektorler, Meta Key is bs_fuarlar_baslangic My Code is; <?php ...
0
votes
1answer
85 views

tax query between operator like

I have a custom post called person and a taxonomy(like tags) called age. As far I have search tax query doesn't seem to support the between operator like meta query does. Is there a way to accomplish ...
1
vote
1answer
180 views

pre_get_posts Tax Query not working for custom author page

I am using the theme TwentyTwelve and modified the standard post query in the file author.php with the following code: function wpd_author_query( $query ) { //CODE to set $current_user_name here ...
2
votes
1answer
152 views

WP_Query tax_query problem

When I call WP_Query with tax query or category__in, I get posts only from first category in array of requested categories. $query = new WP_Query( array( "tax_query" => array( ...
1
vote
1answer
113 views

Hiding taxonomies with no children WP_Query & tax_query

I have this code which has taken over 7 hours to put together through research but the last hours or so I have hit a brick wall! I require the taxonomy title to be hidden if there are no posts ...
1
vote
0answers
28 views

Exclude posts which have any term in a certain taxonomy from the query

I have a custom taxonomy, and for a certain query I am doing, I want to retrieve all posts which do not have any terms of that taxonomy assigned (for example, they are tag-less). At the beginning I ...
1
vote
1answer
258 views

Multiple, nested tax_query relation

I have been stuck on a particular problem for a while now and have yet to find a way around it. I have custom widgets and for each widget I have added the ability to filter posts based on category ...
1
vote
2answers
656 views

Including all terms in wordpress tax_query

I'm a little bit confused, why I can't include all the terms in tax_query automatically? My code: 'tax_query' => array( array( 'taxonomy' => 'city', 'field' => 'slug', ...
0
votes
0answers
38 views

How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?

I just encountered a problem and realized that all tags must be globally unique. Here is what just happened to me: I created a taxonomy called writer and added each author and collaborator to the ...
0
votes
0answers
52 views

wordpress page filter problems

Hello I been working on post type filter so I can filter my content for taxonomies type but for what ever reason I can never get it to filter when I click filter public function product_filters( ...
1
vote
3answers
75 views

Specify number of posts in my 'tax_query'

I'm showing posts of the term 'football' belonging to the taxonomy 'section', and everything works perfectly but Where can I specify the number of posts I want to show? just like this: 'showposts' ...
0
votes
1answer
175 views

in_category() and tax_query with custom post type

I'm using custom post type, that i have named "products" For this post type i have add the custom taxonomies, that have name "products_brand" There are two terms in it now: "natige" and "osakarovka" ...
0
votes
1answer
244 views

Tax query array terms display out of order

I want my tax_query terms to display posts in the order I have them listed in the array below but it is not following the order listed. $args = array( 'post_type' => 'staff', ...
0
votes
2answers
386 views

Ordering Posts with Custom Taxonomy Terms Array

I can't get the order of my posts (organized by custom tax terms) to come out right in my loop. I made a custom post type of 'staff', in staff there is a custom taxonomy of 'staff-title'. I added ...
0
votes
2answers
862 views

Wordpress tax query use operator LIKE

I have taxonomy color which is associated with a custom post type. I am listing all the post meta and the taxonomy in a table. I have a option in the table to search the posts matching the search ...
1
vote
1answer
155 views

tax_query: What to pass when I want to have all terms?

… $args = array( 'post_type' => 'wr_event', 'posts_per_page' => -1, 'meta_key' => 'event_date', 'orderby' => 'meta_value_num', 'order' => $order, 'meta_value' ...
0
votes
1answer
136 views

WP_Query tax_query - Show results if child has parent X

I've made a custom search which includes a 3 tier custom taxonomy that looks like this: continent - country - - state The search is formatting in the above way. Here is my problem: Example data: ...
0
votes
2answers
527 views

When/why does '$query->get( 'tax_query' );' return empty?

First the code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( 'post_type', array( 'post' ) ); ...
0
votes
1answer
218 views

Query set using tax_query with relation 'OR' modifies category object?

(Update: Please see the edits far below.) The code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( ...
0
votes
1answer
284 views

how to access the $query variable inside taxonomy-xxx.php template file?

In my custom template files, I create query in the following way: <?php $query = new WP_Query(array('post_type' => 'aya-bi-aya','author' => $current_user->ID,'paged' => $paged, ...
0
votes
0answers
62 views

Tax Query is only showing normal posts, not Custom Post types too?

This has been bugging me for the best part of a day now, so I'm appealing to help in order to calm my nerves. I run a site that has many custom post types. Every post type shares the use of the ...
0
votes
1answer
216 views

how to use tax_query to apply both terms or one if one is empty

I'm having trouble with getting tax_query to act as a filter for posts. What I would like is to have it so it will display cpt's that have the terms of county and status but also work if terms are not ...
1
vote
2answers
523 views

tax_query not working on main query

I'm using the following code to do a tax_query and it doesn't seem to work anymore.. At some point it was working and for the life of me it wont, anymore. <?php global $pf_override; class ...
1
vote
1answer
307 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
1answer
538 views

Using get_posts() with tax_query parameter set isn't working with attachments

I'm working on a project that requires searching for attachments with a given taxonomy-slug pair (in this case, category=javascript). I'm using get_posts() with tax_query set to achieve this, but it ...
0
votes
1answer
543 views

Exclude post type with pre_get_posts?

I am using pre_get_posts for a custom taxonomy archive display. Now I added a post type 'photo' sharing the same taxonomy with default post type. How can I exclude 'photo' posts being fetched by the ...
0
votes
1answer
162 views

How to get the id or url of the image in an image post?

I have a bunch of image posts and I'd like to get the ID of those images I didn't set a featured image so I can use wp_get_attachment_image_src() to get the urls of various sizes of those images. ...
1
vote
1answer
1k views

Why is my WP_Query not working when tax_query terms are an array?

I have an issue with a WP_Query for a site I'm building which has me stumped. This works as expected: $package_args = array( 'post_type' ...
0
votes
1answer
106 views

Advanced AND tax_query in sidebar with 2 taxonomies

I have two taxonomy : brand and product. In single sidebar I am displaying the brand and product of the post in the sidebar but I would like to display all the other product of the current taxonomy ...
7
votes
1answer
3k views

Multiple relationship for multiple tax_query in WP_Query

I want to use the WP_Query class to filter some of my posts. The problem I facing now is handling the taxonomy query. Normally, the wp_query only handle one relationship for tax_query (either AND or ...
0
votes
1answer
2k views

tax_query in get_posts() not working?

I'm trying to print out all the posts within every taxonomy for a custom post type called product (jigoshop products). So i get all of the taxonomies using $cats = get_terms('product_cat');, then i ...
1
vote
1answer
706 views

When tax_query used, results disappear (0 =1 produced)

I'm trying to perform a dynamic query that uses a dynamically passed taxonomy and post_type, and displays results accordingly — A user makes a selection from 3 drop-downs on a form, each have a ...
0
votes
2answers
465 views

How to update Wordpress custom SQL Select query for custom taxonomies so that syntax is correct?

I have a Wordpress website that written by third party web developer for version 2.9 before custom taxonomies were fully implemented. We have since upgraded to latest wordpress version 3.5.x. There ...
0
votes
1answer
304 views

Set tax_query conditionally with new WP_Query

I have a page template with a custom query: <? $filter = explode(' ', $_GET['filter']); // "page/?filter=taxonomy+term" $paged = get_query_var('paged') ? get_query_var('paged') : 1; $query = new ...
0
votes
1answer
179 views

Cannot query custom post type taxonomy from theme options array

I am having no luck with querying a custom post type taxonomy from an array in theme options. My full code is below, would be grateful for some feedback to get it working correctly as I cannot get ...
-1
votes
1answer
84 views

why do drafts return as part of wp_query?

I have some code as plugin, which I call via AJAX from a page one the site. It gets two drop-down values and uses them in tax_query to fetch some posts. Question: why do drafts return amongst results ...
2
votes
2answers
235 views

How to output content based on same custom taxonomy?

I have been trying to output content of all post-types (Posts, Pages and CPTs) based on a term of a custom taxonomy that they must share (meaning if they don't share that particular term, the output ...
6
votes
1answer
6k views

Custom Taxonomy and Tax_Query

I've been having a lot of trouble getting a WP_Query running with a tax_query on my custom taxonomy. I'm 99.9% sure that my register_taxonomy is correct, as I'm able to tag posts with the right term, ...
0
votes
1answer
258 views

Tax_Query using WP_Query not working

I cannot get this query to work properly. It just renders one post even though I have three posts that are categories in the 'Firm News' and 'Test' categories. Can anyone see a problem with my code? ...
0
votes
2answers
204 views

How can i simulate “taxonomy__in” in query?

How can I have to set tax_query to get results like 'category__in' => array()? Specifically, I would like to show all the posts that have a term from the city taxonomy with one of these id's: $cities ...