Sticky post only on first page
-
Hi,
Thanks for this theme, it works like a charm!I haven’t been able to work out one problem though: I’ve edited your theme quite a bit to fit the needs of my friend and installed the Infinite Scroll plugin for lazy loading. I’ve noticed that sticky posts are shown on every page (without the Infinite Scroll plugin, that is) and so they also load again with every scroll, causing a lot of duplicate posts on the index page.
Can you think of any changes I can make in the code to prevent this from happening and only have the sticky post appear only once?
I have tried adding !is_paged to the loop template as follows:
<article id=”post-<?php the_ID(); ?>” class=”post columns four <?php echo sampression_cat_slug(); ?> <?php if ( is_sticky() && is_home() && !is_paged() ) { echo ‘item sticky’; } else { echo ‘item’; } ?> “>
But that didn’t help…
Kind regards,
Marloes
- The topic ‘Sticky post only on first page’ is closed to new replies.