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' => 'vamos-cpt-packages', 'tax_query' => array(...
Question How to output tag related posts first, then IF there are less than 4 tag related posts, fill the rest of the 4 spots with category related posts?...
I’m trying to alter the search functionality of a WooCommerce store so when a user makes a query that matches a product_tag slug it returns the products that don’t...
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...
I want to make a custom WP_Query using custom taxonomy terms ID´s. Example of the term’s ID’s : 19,18,214,226,20 Why does this work: $query_args = array ( 'post_type' =>...
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', 'terms' =>...
I need to adjust the main loop for all archive pages in the following way. I have registered a custom taxonomy “myposttypes”. Every single post is assigned to exactly...
Let me start saying that I know a ‘tax_query’ is faster than ‘meta_query’. It’s always recommended to use taxonomies over custom meta when filtering by custom data is required,...
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...
First the code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( 'post_type', array( 'post' ) ); // Get current tax query $tax_query = $query->get(...