All Questions
147
questions
0
votes
1
answer
19
views
Adding a language rule and displaying posts with a custom taxonomy term on its archive page
The WordPress website I'm working on is available in two languages using Polylang, en-US and en-PH. I use CPT UI and have a custom taxonomy "subtopic" that is not multilingual. Under "...
1
vote
0
answers
10
views
Same query args showing different results order when setting different number of posts
This query using the same arguments is returning different posts order:
sample / test codes:
// Query 1
$query_args = [
'post_type' => 'business',
'showposts' => 8,
'no_found_rows' =&...
2
votes
1
answer
714
views
Custom query with custom filtering returning incorrect results
I've setup a custom query, I'm using Woocommerce and I am aware that it has it's own functionality, but have been tasked with creating custom filtering with a traditionally paged product/category ...
0
votes
0
answers
272
views
Custom Query: Multiple CPTs and a taxonomy filter
I want to create a post feed that displays the following:
ALL posts in the CPT 'custom_post_type_1'
Any 'post's in the category 'speakers'
So far, I have this filter which displays all posts in '...
0
votes
0
answers
115
views
Any quicker alternative for WP_Query "NOT IN"
I am using the following wp_query to pull up a list of post, and I want to exclude a few categories of a custom taxonomy.
It works well, however Query Monitor is telling me that the query is slow.
I ...
0
votes
0
answers
977
views
Tax Query on product_cat using NOT IN as operator does not exclude that category
Using the following code, I expect $items to not include products with the product category "stones." However, that is not the result. It doesn't seem to be excluding that category at all. ...
3
votes
1
answer
472
views
Fastest way of counting posts of a custom post type in a specific taxonomy term?
I know this kind of question is legion but I have read through all related topics and I can't find a satisfying solution.
What I want to achieve is simple: on my taxonomy (author) term archive page I ...
0
votes
1
answer
370
views
Tax Query only returns for the first of several terms
I'm trying to query a customer post type where the results may be within one of several associated terms. The issue however is that only the first term yellow-gold-jewellery is being returned for, and ...
0
votes
0
answers
127
views
Facing problem with tax_query results
I need to get search results for posts on the basis of post-category(must) and posts-tags(optional).
The process is like:
search for a string e.g. "bananas"
the category is always static
...
1
vote
1
answer
4k
views
Adding a tax_query to a WP_Query Object
Is it possible to modify a WP_Query object to add a tax_query?
That is -- I'm able to add a tax_query when instantiating a WP_Query object
$q = new WP_Query(array(
'post_type' => 'post',
'...
0
votes
1
answer
440
views
Show posts from two specific category in WP_Query
I've two category employee and full-time. If a post publish in both (employee and full-time) category then the post will show in his specific section. If post has only employee category, not full-time ...
0
votes
1
answer
693
views
Display related CPT with custom taxonomy
I have two custom post types: "storefront_location" and "services"
These are linked by a custom taxonomy "location"
I am building a post template for "...
0
votes
0
answers
139
views
WP Query should show No Posts when tax_query $args taxonomies don't have associated posts
I have a simple query. Getting the posts only if it have both the taxonomies in it.
$args = array(
'post_type' => 'treatment',
'tax_query' => array(
'...
0
votes
0
answers
49
views
Multiple dynamic Tax Query - pass taxonomy argument from array
I need to make a multiple dynamic tax query
$args['tax_query'] = array(
'relation' => 'AND',
array(
'taxonomy' => $taxonomies,
'field' =&...
1
vote
1
answer
889
views
Get list of terms that have posts in another term
I have a product attribute called "color" and when I am on the archive page (e.g. color=blue) I want to display a list of all the parent product categories that contain products with that ...