WordPress.org

Ready to get started?Download WordPress

Forums

Sampression Lite
[resolved] Sticky post only on first page (2 posts)

  1. throwingmarbles
    Member
    Posted 1 year ago #

    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

  2. throwingmarbles
    Member
    Posted 1 year ago #

    Hi,
    This turned into quite a mess over the weekend and I got very discouraged after reading this:

    http://isotope.metafizzy.co/docs/help.html#infinite_scroll_with_filtering_or_sorting

    Seems like the two don't combine very well at all and the duplicate sticky posts are the least of my problems. ;-) Do you have plans to try and implement infinite scroll in your theme in the future?

    Regards,
    Marloes

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic