[Support request] Articles not changing (homepage) Next Page >

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Articles not changing (homepage) Next Page >

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #25222
    Charbel
    Participant

    Hello Tom,

    Hope you are doing well.

    Please note that I have noticed that articles are not changing when I browse to different pages on my homepage.

    I tried everything noted here but https://generatepress.com/forums/topic/pagination-not-working/ is not working!

    Here is my staging website: http://wpcharbelnemnomblog.northeurope.cloudapp.azure.com/
    Page 2: http://wpcharbelnemnomblog.northeurope.cloudapp.azure.com/page/2/

    It’s always showing the same (11) articles below.

    Your help is highly appreciated!

    Thank You!
    -Charbel

    #25447
    Charbel
    Participant

    Hello @Tom and @Elvin,

    Could you please help on resolving this issue.

    I tried everything noted here https://generatepress.com/forums/topic/pagination-not-working/ but is not working!

    Homepage: http://wpcharbelnemnomblog.northeurope.cloudapp.azure.com/
    Page 2: http://wpcharbelnemnomblog.northeurope.cloudapp.azure.com/page/2/
    Page 3: http://wpcharbelnemnomblog.northeurope.cloudapp.azure.com/page/3/

    As you can see, WPSP articles are not changing, the latest articles remains the same when the reader browse to a different page.
    This site has more than 500 articles/posts.

    Your help is highly appreciated!

    Thank You!
    -Charbel

    #25449
    elvin
    Moderator

    Hi,

    Can you check if the list with pagination has offset?
    There’s a known bug with pagination if the list has offset. It’s already logged as one of the issues to be fixed for the next version.
    https://github.com/tomusborne/wp-show-posts/issues/24

    Also, can you try removing the WPSP list on the page hero as well? Pagination for multiple loops in one page is known to be buggy.

    • This reply was modified 3 months, 3 weeks ago by elvin.
    #25458
    Charbel
    Participant

    Thank you @Elvin, much appreciated!

    This video helped me to understand the Offset issue. My Offset was set to 1, I removed it and the pagination start working now.
    https://screencast-o-matic.com/watch/cFh3YPbEUv

    As I can see this is a very old bug from 2018 and still not fixed. I hope this will be fixed very soon. What Offset can help please?

    Sorry, I did not understand the second one:

    Also, can you try removing the WPSP list on the page hero as well? Pagination for multiple loops in one page is known to be buggy.

    Could you please clarify further?

    Thanks @Elvin!

    #25462
    elvin
    Moderator

    Also, can you try removing the WPSP list on the page hero as well? Pagination for multiple loops in one page is known to be buggy.

    No need to do this anymore as we’ve found the issue which is a known bug. (offset)

    As I can see this is a very old bug from 2018 and still not fixed. I hope this will be fixed very soon. What Offset can help please?

    I’m not exactly sure if Tom has already fixed this on one of the unreleased alpha versions. I’ll make sure to notify Tom about this and see if he has anything.

    We’ll let you know. 🙂

    #25464
    Charbel
    Participant

    Thank You @Elvin!

    Looking forward for update on this.

    Thanks!

    #25467
    Charbel
    Participant

    Hello @Tom,

    Your help is highly appreciated please.

    I removed offset -1 which removed the first post from showing. As you can see now http://wpcharbelnemnomblog.northeurope.cloudapp.azure.com the featured post and the first one in the list are the same.

    I hope this can be fixed very soon please.

    Thanks!

    #25500
    elvin
    Moderator

    If I may suggest a workaround while this is being fixed.

    You can try adding this PHP snippet on your site:

    add_filter('post_link', 'track_displayed_posts');
    add_action('pre_get_posts','remove_already_displayed_posts');
     
    $displayed_posts = [];
     
    function track_displayed_posts($url) {
      global $displayed_posts;
      $displayed_posts[] = get_the_ID();
      return $url; // don't mess with the url
    }
     
    function remove_already_displayed_posts($query) {
     global $displayed_posts;
     $query->set('post__not_in', $displayed_posts);
    }

    Here’s how to add PHP snippets: https://docs.generatepress.com/article/adding-php/

    #25506
    Charbel
    Participant

    Thank You @Elvin, much appreciated!

    The code above solved the Featured post and the pagination still works fine.
    We don’t have duplicate post anymore. You can check it here 🙂 http://wpcharbelnemnomblog.northeurope.cloudapp.azure.com

    So this is a temporary fix. I would really appreciated to be notified ahead so I can remove the code after the fix is added to WPSP plugin.
    In this case I can put back Offset 1.

    Many Thanks @Elvin!

    #25600
    elvin
    Moderator

    No problem. We’ll keep you posted. 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.