The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
2answers
48 views

Dynamically tax_query terms

To display all the categories name with checkbox from custom taxonomy called ct_category I have the following code: $terms = get_terms('ct_category'); foreach ( $terms as $term ) { echo '<li ...
0
votes
2answers
240 views

How to restrict search on a certain page to only return results against custom taxonomies?

On a specific page, I would like the search to be performed only against the terms from two custom taxonomies. Not the content or title. That is, the user is directly searching taxonomy terms. What I'...
1
vote
1answer
263 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 ...
0
votes
1answer
30 views

Custom taxonomy and query multi conditions

I have this query $query->set( 'tax_query', array( 'relation' => 'OR', array( 'taxonomy' => 'location', ...
0
votes
1answer
42 views

Get term by custom term meta and taxonomy

How to get term by custom term meta and taxonomy or how to filter tax_query by term meta instead slug/id? function custom_pre_get_posts($query) { global $wp_query; if ( !is_admin() &&...
0
votes
1answer
25 views

Get pages only with a specific taxonomy

I added a custom taxonomy called 'post_tag' to the pages, and I am trying to make a query that gets only the pages that have a specific tag set. I already tried in several different ways, even using ...
0
votes
1answer
49 views

Custom arguments in WP_Query

I am working on a Wordpress theme i.e. Directory engine. It is having a filtering functionality in the header based on taxonomy term slug. I just want to know from where this tax_query is generated ...
0
votes
1answer
72 views

Extending WP Query: Custom geolocation meta values work, but tax_query breaks

I've built a custom query for geolocation searches. I'm saving lat and lng within each custom post type as a meta value. My query extension returns results successfully when lat and lng are the only ...
0
votes
1answer
29 views

How to get hierarchical number of custom taxanomy

I have custom taxonomy some thing like : Item - A Item A-1 Item A-2 Item A-2-1 Item A-2-2 Now i want to get what is the number of hierarchical number of Item A-2, if we start from 0 it ...
0
votes
1answer
296 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
51 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
297 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
275 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
169 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
1answer
136 views

Custom Query Arguments

I want to run a query base on the following $args. My question that how to pass variable number of arrays to tax_query as currently i have two arrays within tax_query it can be 1 , 3 or 5 and so on. ...
-1
votes
1answer
143 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 (...
-1
votes
1answer
176 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, '...
1
vote
0answers
316 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', ...
1
vote
0answers
91 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 ...
1
vote
0answers
41 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 ...
0
votes
0answers
44 views

Query breaking with 'posts_per_page' => -1

I'm trying to return all posts for a category associated with a custom post type. I have the following query: $cat_name = single_cat_title('', FALSE); $termObj = get_term_by('name', $cat_name, '...
0
votes
0answers
27 views

Get posts from multiple post types and exclude posts of specific post type by `tax_query`

get_posts( array( 'posts_per_page' => 10, 'post_type' => array( 'post_type_1', 'post_type_2', ), 'tax_query' => array( array( '...
0
votes
0answers
39 views

Remove custom post type from specific page

I have a situation where I am trying to remove a specific custom post type (a portfolio type item) from a certain page. I was able to remove the specific category I want to hide from appearing ...
0
votes
0answers
65 views

Empty 'terms' in 'tax_query' returns an empty array

I would like a simple search on the products page, so I built a custom WP_Query. $args = array( 'post_type' => 'products', 'meta_key' => 'product_price', 'meta_value' =...
0
votes
0answers
49 views

List of CPT posts listed under associated custom taxonomy terms only displays 10 posts per term - how to change/remove limit?

I have some code which displays a list of posts based associated terms like this: Term 1 Post 1 Post 2 Post 3 Term 2 Post 4 Post 5 Post 6 And so on. And it does the job to an extent. A few of ...
0
votes
0answers
23 views

Multi operator in tax_query

I have this code /* TERMS 1 = "ASUS" 2 = "GIGABYTE" 33 = "1151" */ I'm and using query post to get data "tax_query" => array( array( "taxonomy" => "product_cat", "field"...
0
votes
0answers
39 views

Custom query for tag and custom tag from 2 post type

I have custom post type called items and added custom taxonomies type and sub-type. I like to query posts from both post and items post type that has art as either Tags or Sub type. Below is what ...
0
votes
0answers
69 views

WP_Query: Meta_Query with serialized value (or a workaround)

I have a post type Issue, that has meta values in form of associative arrays (that are saved as serialized strings to database). They look somewhat similar to this: [article_reviews] => Array (...
0
votes
0answers
51 views

Multiple tax_queries: display posts titles from several custom taxonomie

Im trying to get this work. They do individually. function render_main_menu (){ $cpt = 'mycpt'; $tax = 'section'; $term = 'main'; $tax2 = 'paragraph'; $term2 = 'sub'; $loop = ...
0
votes
0answers
74 views

Is there a good way to get all queried taxonomy terms?

For most cases, getting the queried taxonomy term is as simple as calling get_queried_object(), but I have noticed that if multiple taxonomy terms are queried, that function only returns one of them. ...
0
votes
0answers
31 views

Secondary ordering and order DESC not working when using meta_value_num

I have this query: $args_members = array( 'posts_per_page' => -1, 'post_type' => 'team_member', 'post_status' => 'publish', 'meta_key' => ...
0
votes
0answers
65 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
0answers
484 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 = ...
0
votes
0answers
39 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
0answers
155 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
75 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 ...