Infinite Scroll with excluded category
-
Hello All,
I’m trying to create a homepage with a post listing running infinite scroll, but i am having having some weird behaviour with excluding a category from the loop.
the first page of the loop is displayed as it should (without any posts from the excluded category), but when the infinite scroll loads the subsequent pages, it is not excluding the desired category anymore.
here is the code i am using:
<?php $infquery = new WP_Query( 'cat=-9' ); ?> <?php if ( have_posts() ) : ?> <?php while ( $infquery->have_posts()) : $infquery->the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?>
Anyone have any idea of what i am doing wrong?
Thanks in advance,
Bruno
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Infinite Scroll with excluded category’ is closed to new replies.