Home › Forums › Pro Support › Articles not changing (homepage) Next Page >
- This topic has 9 replies, 2 voices, and was last updated 2 years, 8 months ago by
elvin.
-
AuthorPosts
-
January 10, 2021 at 11:33 am #25222
Charbel
ParticipantHello 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!
-CharbelJanuary 14, 2021 at 1:15 am #25447Charbel
ParticipantCould 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!
-CharbelJanuary 14, 2021 at 1:47 am #25449elvin
ModeratorHi,
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/24Also, 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.
January 14, 2021 at 2:11 am #25458Charbel
ParticipantThank 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/cFh3YPbEUvAs 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!
January 14, 2021 at 2:20 am #25462elvin
ModeratorAlso, 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. 🙂
January 14, 2021 at 2:22 am #25464January 14, 2021 at 3:09 am #25467Charbel
ParticipantHello @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!
January 14, 2021 at 8:39 pm #25500elvin
ModeratorIf 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/
January 14, 2021 at 11:52 pm #25506Charbel
ParticipantThank 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.comSo 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!
January 17, 2021 at 6:55 pm #25600elvin
ModeratorNo problem. We’ll keep you posted. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.