Support

Account

Home Forums General Issues Numberposts & Meta Query Not Working Reply To: Numberposts & Meta Query Not Working

  • OK… I finally got it. This is what the correct query should have been, combining ACF and CPT arguments:

    $relatedCat = get_field('service_related_industry');
         $args = array (
    		'posts_per_page' => 3,
                    'post_type' => 'case_study',
    		'tax_query' => array(
    			array(
    				'taxonomy' => 'cs_industry',
    				'terms' => $relatedCat,
    				'field' => 'term_id',
    			),
    		),
    		'tag_id' => '"'.$relatedCat.'"',
    		'orderby' => 'DESC',
          );