Help with a query not working with custom taxonomy

Try something like this:

    $sotmArticle_query = new WP_Query(
      array(
        'post_type' => 'news',
        'tax_query' => array(
                           array(
                                  'taxonomy' => 'postCat', 
                                  'field' => 'slug', 
                                  'terms' => 'sotm'
                           )
                       ),
        'orderby' => 'date',
        'order' => 'DESC',
        'posts_per_page' => 1
     )
    );
    if($sotmArticle_query->have_posts()){
        while($sotmArticle_query->have_posts()){ $sotmArticle_query->the_post();
?>

Leave a Comment