Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
122 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. ...
4
votes
1answer
5k 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 ...
2
votes
1answer
150 views

Query all posts in a given taxonomy

For sure it's very simple, but I can not figure out how to do this. I need to query all posts that has a specific taxonomy set. Like this: $query03 = array( 'numberposts' => 5, 'post_type' ...
0
votes
2answers
257 views

WP_Query parameter conflict

I am writing a query to retrieve instances of a custom post type I created called "Specialist". In the query I specify a name and more than one taxonomy. I want to retrieve just those specialist which ...
1
vote
1answer
876 views

Problem with get_posts, tax_query and counting the number of posts

I want to count the number of posts that has simoultaneously 3 different taxonomies. THe code i'm using is this: $products = get_posts(array( 'post_type' => 'products', 'posts_per_page' ...
2
votes
1answer
449 views

Order posts by (hierarchical custom) taxonomy terms and term children

The scenario a custom post type wiki a (hierarchical) custom taxonomy topics a page template archive-wiki.php The situation Posts show up and get ordered by post_date (which is the default). The ...
0
votes
2answers
191 views

tax_query not working in template

I have a custom post type called 'product' with a registered taxonomy 'product-type'. I want to display all post from a particular taxonomy from custom post type. In my case I want to display all the ...
0
votes
1answer
292 views

Tax query not producing any results

I have created a custom post type called 'course' which has 7 posts each being an individual training course. I've also tagged them with individual custom taxonomies 'course_codes' eg. h001, h002, ...
1
vote
1answer
915 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 ...
1
vote
2answers
283 views

How to add terms to my tax_query based off of the current post

I need the terms in my tax_query to be the ones from the current post. I am trying to this by using a variable. The value of the variable is given by using the get_terms() function. The problem is ...
2
votes
1answer
2k views

How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero

Is there an easy way of obtaining every registered taxonomy and for each registered taxonomy, get all the terms for that taxonomy, and for each term, get the post count, without actually fetching all ...
0
votes
1answer
360 views

Show multiple tax_query from 2 or more post_type in a single code

i've been trying with no success to show 2 custom taxonomies from 2 post_type, here's my code: <?php /** * Display a list of the most recent news in 'Avisos' ...
0
votes
2answers
469 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) { ...
0
votes
1answer
2k views

Conditional arguments for WP_Query and tax_query depending on if $somevar has a value

I've created a new query for a custom post type of 'courses'. Those results are then to be filtered using tax_query, querying 3 custom taxonomies matching 1 or several term ID's. These are passed from ...
1
vote
1answer
279 views

Using tax_query reverses my post_type argument in a custom WP_Query

I'm using a custom query to pull some posts from a custom post type. I'm having problems with it so I used print_r on my WP_Query object and I found something strange. my query has these arguments: ...
0
votes
1answer
2k views

How to do a particular wp_query taxonomy search

I have added a custom taxonomy called experience to the page post-type, and the taxonomy has terms "vfds" and "plcs" I am trying to create a search where a user can select one or more experience ...
2
votes
1answer
6k views

“tax_query” parameter not working with WP_Query

I have a custom post type called 'episode'. Attached to 'episode' I have a custom taxonomy called 'video_type' that contains two terms: "bonus-footage" and "episode"; "episode" contains two child ...
1
vote
1answer
553 views

Query Multiple Taxominies Across Multiple Post type's

i have searched and found some aprroved answers to similer questions but nothing i could make work or something exactly like my issue... i have 5 custom post type... each one have its own taxmonies ...
0
votes
1answer
504 views

How to limit posts to 1 from each term with tax_query?

Need 1 post from each. <?php global $post; // required $args = array ( 'tax_query' => array ( 'relation' => 'AND', array ( ...
3
votes
4answers
9k views

Query posts by custom taxonomy ID

I have a custom post type called portfolio and a custom taxonomy called build-type (acting as categories) I am trying to query portfolio posts by build-type ID e.g. all Portfolio posts in "Hotels" ...
0
votes
2answers
534 views

Query all posts under one taxonomy? Why is my code not working?

I'm trying to show all the posts associated with a Taxonomy (not a term) but it seems to not work. <?php $args = array( 'post_type' => 'projects', 'tax_query' => array( ...