Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter drushton

    (@drushton)

    Same 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

    Thread Starter drushton

    (@drushton)

    So 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…

    Thread Starter drushton

    (@drushton)

    p.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)