Exclude category from home
-
Hi,
i want exclude a category from homepage, but don’t work my code:<?php if( $category_items_query->have_posts() ): ?>
<div class=”row columns-layout content-grid”>
<?php if( $layout === ‘two’ ): ?>
<!– EXCLUDE CATEGORY 17 –>
<?php query_posts($query_string . ‘&cat=-17’); ?><?php while( $category_items_query->have_posts() ): $category_items_query->the_post(); ?>
<div class=”col-lg-6 col-md-6 recent-item two-columns post-box”>
<?php get_template_part( ‘parts/home-content’, ‘columns’ ); ?>
</div><!– .two-columns –>
<?php endwhile; ?><?php else: ?>
<?php while( $category_items_query->have_posts() ): $category_items_query->the_post(); ?>
<div class=”col-lg-12 recent-item one-column post-box”>
<?php get_template_part( ‘parts/home-content’, ‘columns’ ); ?>
</div><!– .one-column –>
<?php endwhile; ?><?php endif; ?>
</div><!– .row –><?php endif; ?>
Please help me.
Thanks
Guido
- The topic ‘Exclude category from home’ is closed to new replies.