(Update: Please see the edits far below.) The code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( 'post_type', array( 'post' ) ); $query->set( 'tax_query',...
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...
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(...
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...
I have a custom post type Wine, which has an ACF Field that links to another custom post type Producer as a post_object relation. In my Producer, I have...
I need to get a complex result set from a WordPress database according to the category structure. First I will try to explain my category structure. I have three...
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...
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...
I am creating a real estate website on WordPress, I am creating a custom search and am using tax_query to filter search results to display “States” & “Suburbs”. The...
I have some code as plugin, which I call via AJAX from a page one the site. It gets two drop-down values and uses them in tax_query to fetch...