drushton
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Fixing WordPress
In reply to: Display posts belonging in 1 category as well as othersSame fix for query 1:
foreach($portfolio_categories as $portfolio_category) { $args = array( 'post_type' => 'portfolio', 'posts_per_page' => '-1', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'project-category', 'field' => 'slug', 'terms' => $portfolio_category->slug ), array( 'taxonomy' => 'project-category', 'field' => 'id', 'terms' => 37 ) ) // end of tax_query );
This has however broken the data-filters
Forum: Fixing WordPress
In reply to: Display posts belonging in 1 category as well as othersSo changing Query 2 args using a custom tax query to:
<?php $args = array( 'post_type' => 'portfolio', 'orderby'=>'menu_order', 'order' => 'ASC', 'posts_per_page' => '-1', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'project-category', 'field' => 'id', 'terms' => $catorg, 'operator' => 'IN' ), array( 'taxonomy' => 'project-category', 'field' => 'id', 'terms' => 37 ) ) // end of tax_query ); ?>
fixes the issue with Query 2.
Now onto Query 1…
Forum: Fixing WordPress
In reply to: Display posts belonging in 1 category as well as othersp.s. I assume it is a tax_query for query 2 but not sure about query 1. I haven’t been able to get it to work however.
Also, Query 1 feeds into a category selector using a data-filter. Not sure how this affects things if at all?
Viewing 3 replies - 1 through 3 (of 3 total)