Exclude Category by name, underscore _s
-
I am trying to implement the exclude by category name into loop (underscore _s theme)
and I have this so far , where and how to I make it work?<?php wp_reset_postdata(); // Resetting previous WP query ?> <?php $args = array( 'post-type' => 'post' ); $exclude = get_cat_ID('featured'); $exc = 'cat=-'.$exclude; $the_query = new WP_Query ( $args, $exc ); ?> <?php if ( have_posts() ) : ?> <?php while ( $the_query -> have_posts() ) : $the_query -> the_post(); ?> <?php get_template_part( 'content' , 'landing' ); ?> <?php endwhile; ?> <?php endif; ?>What am I doing wrong? Query still shows posts with featured category.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Exclude Category by name, underscore _s’ is closed to new replies.