The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
784 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
1answer
590 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: ...
0
votes
1answer
375 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
0answers
13 views

WP_Query relation AND with two taxonomies and orderby rand, prioritising one taxonomy

I have a wp_query which selects posts from a CPT, using relation AND to select posts from two taxonomies (sector and expertise). I would like the order of posts returned to be random but I would still ...
0
votes
1answer
19 views

Empty tax_query array returns an empty array

I would like to return all posts when the tax_query['terms'] is empty. $args = array( 'post_type' => 'product', 'posts_per_page' => 15, 'paged' => $paged, ...
1
vote
2answers
1k 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
0answers
23 views

Filter search result by either a taxonomy1, or a taxonymy2, or both taxonomy1 and taxonomy2

I'm trying to build a search site for non-profit website, where dog owners can find restaurants (in selected city and with selected cuisine type) where they will be let in with their dog. The problem ...
0
votes
1answer
46 views

Using tax_query to get single post per category

I have a list of magazines I need to categorize and sort. I have created a custom post type and registered a custom taxonomy to organize them. Category Structure: Print Magazines (parent category) ...
0
votes
1answer
31 views

Querying by taxonomy vs Querying by Custom fields Speed Comparison

I'm developing a listing portfolio for our project. (Basicaly yachts with their type, size, price, cabins, draft, build year, refit year etc.) I should filter them according to type and sort by ...
0
votes
1answer
40 views

Multiple terms not working on taxonomy

I need multiple terms support my WordPress theme - $boards = get_user_meta($user_ID, '_Following Board ID'); $pboards = get_user_meta($user_ID, '_Board Parent ID'); $paged = (get_query_var('paged')) ...
0
votes
1answer
53 views

using multiple terms in tax_query

I'm trying to build a real estate search site. first of all, here is the search form (sorry for german classes and stuff tho): <form method="post" action="<?php ...
1
vote
1answer
114 views

pre_get_posts: using tax_query only for certain post type

I have default post type posts (post type: post) and custom post type posts (post type: cpt). The latter has a taxonomy (cpt_tag). I would like to display on my front page all the default post type ...
0
votes
1answer
1k 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
2answers
746 views

Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request

This is my first attempt at modifying the main query using the pre_get_posts action/filter This is the function currently hooked to it: function advanced_product_search_filter($query) { ...
5
votes
2answers
9k views

Nested meta_query with multiple relation keys

I am curious whether Wordpress is able to run nested meta_query, with each having different relation keys? As of Wordpress 3.0, tax_query is able to perform this function; I'm wondering whether this ...
3
votes
1answer
264 views

Escaping WP_Query tax_query when term has special character(s)

Here's my issue. I have a custom post type that I'm attaching a custom taxonomy to. This taxonomy will allow the admin to provide search suggestions that will ensure the post is found when a user ...
0
votes
0answers
39 views

Custom Taxonomy in WP_Query not returning any results

This is how I'm doing myWP_Query, it gets the query_var because I'm using it with my custom post_types as well. The thing is it's not filtering anything! It gets all results for that post_type and ...
0
votes
1answer
54 views

List posts of terms but exclude one term

I have a Custom Post Type for "Products" with a Custom Taxonomy of "Product Line." I've set up a page to list out the Products by their Product Line. However, we're also using a Product Line of ...
3
votes
2answers
190 views

template_include for search.php makes Wordpress think its on the home page

I have a custom tag-search feature, which allows people to search multiple tags to return relevant posts. Say they want to see posts that are tagged both 'Wordpress' and 'Tutorials'. I'm using the ...
1
vote
0answers
124 views

tax_query OR with empty result returns all posts

I'm running a WP_Query with a tax_query with two tax_query statements with an OR relationship. $tax_query_terms = array( array('taxonomy' => 'post_tag', ...
0
votes
1answer
93 views

Function using get_posts() with tax_query not working when called from functions.php

I want to get an array of all the 'bands' in taxonomy 'types', and use the array later on in other functions etc. I have a utilities.php file that I require() in functions.php and it has the following ...
0
votes
1answer
26 views

Running a custom query inside another cpt single and trying to grab a variable

I made a cpt "Neighborhoods" for different neighborhoods. On the Neighborhoods archive, you click on one and go to the single. All good. an example url is /blog/neighborhoods/south-austin/ But I'm ...
0
votes
1answer
84 views

pre_get_posts main_query not displaying after applying tax_query filters

Maybe someone can help me identify a problem I am experiencing with the pre_get_posts action. I have used the same code in another project before and it worked fine. I even went through line by line ...
0
votes
1answer
142 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 ...
2
votes
1answer
192 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( ...
0
votes
0answers
302 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
66 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
106 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
91 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
32 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( ...
-1
votes
1answer
108 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
163 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
148 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
305 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 ...
1
vote
1answer
190 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
32 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
424 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
2k 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
84 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 ...
1
vote
3answers
185 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' ...
1
vote
1answer
328 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
465 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
2k 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
326 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
222 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: ...
1
vote
2answers
965 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
407 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
69 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 ...
1
vote
1answer
412 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
663 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 ...