Tagged: enfold pagination
-
AuthorPosts
-
July 30, 2020 at 9:33 pm #1234233
I’m creating a new site with Enfold, and am having an issue with the “Blog Posts” element behavior. Here is a link to the issue:
The Blog Posts element is set to show 3 posts at a time, with pagination turned “on”. The issue I’m having is when you click to go to the “next page” of 3 blog posts it jumps all the way back to the top of the page rather than staying put, so you have to scroll back down to see the next three posts.
The same issue also occurs using the “Magazine” element displaying blog posts on the landing page:
Can you please take a look and let me know why this is happening and how to fix the issue?
I’m happy to provide access to the site if that’d be easier.August 3, 2020 at 7:37 am #1234734Hey Trey,
Thank you for the inquiry.
That is actually the expected behavior because the pagination only redirects to the next or previous page but not to any anchors or sections inside of it. This is also why it’s not recommended to add any paginated elements other than the top of the page. As a workaround, you can use the script provided in the following thread, but it may require you to move the blog posts element inside a section, or you may need to add an anchor inside the current page.
// https://kriesi.at/support/topic/anchor-blog-pagination-to-same-page-location
Best regards,
IsmaelAugust 3, 2020 at 6:31 pm #1234919Hi Ismael,
Thanks so much, and I hope I’m understanding your response.
Are you saying the expected behavior of pagination in both the Enfold “Blog Posts” and “Magazine” elements is to jump to the top of the page, rather than staying put within their section(s)? And because of this, you’re advising not to use these built in features of Enfold, is this correct? It appears from other comments the “Portfolio” element also has this problem. What Enfold element(s) should I use instead to display blog posts and excerpts of posts with pagination? Please advise.
Secondly, the recommended “workaround” is that I should either place these elements inside of a section(s), or add anchors inside the current pages — both of which, I have. The pages I linked to in my original inquiry were built this way. The Latest News section on the About Us page has the “Magazine” element inside of a color section anchored “latest-news”. The Ethics section on the Our Work page “Blog Posts” element is anchored “ethics”.
I reviewed the thread in the link you provided, however I’m unsure where to add the code and whether it would fix the pagination issue globally. It appears the code directs the elements pagination to an anchor called “#home-blog” which doesn’t exist on my site, so I am unsure if it will work. Could you please let me know?
Thank you.
August 6, 2020 at 4:24 am #1235572Hi,
Yes, that’s the expected behavior but we are not saying that you shouldn’t use the element, just avoid placing it in the middle or at the very bottom of the page. It should be at the very top or the only element in the page if you don’t want to add extra modification or script. If you really need the element to be paginated but it’s not located at the top of the page, then you have to do the modifications that we suggested previously.
If the element is already inside a section with a unique ID, then all you need to do is modify the script or this line..
jQuery(this).attr("href", theLink + "#home-blog");
.. and replace #home-blog with the actual section ID.
jQuery(this).attr("href", theLink + "#latest-news");
The script will append the anchor to the pagination links so that when clicked, instead of going back to the top, it will directly go to the section containing the posts.
Best regards,
IsmaelOctober 2, 2020 at 8:06 pm #1250197before i open a new thread for this same problem, is there not a way to simply put the posts in a slider that doesn’t need any reloading of the page at all? Pagination seems quite silly because I think most users expect it to load immediately in the same place instead of the whole page reloading and then getting redirected to the posts. It’s extremely jarring and a great way to lose users on the spot.
Is there code for the posts to be in a sliding gallery? Or for the pagination to work as such? Or has the way you designed it forced it to reload the page no matter what?
October 6, 2020 at 12:01 pm #1250819Hi,
@mbesh: What do you mean by “simply put the posts in a slider”? Are you referring to the post slider element?
The modification or script that we provided in the previous thread will apply an anchor to the pagination links so users will automatically get redirected to the actual section where the blog posts element is. This is only needed when the posts element is not added at the very top of the page or if it is located somewhere in the middle or at the very bottom of the page. With the script, users will not have to scroll manually again to the posts section because of the added anchor in the pagination links.
Best regards,
IsmaelOctober 6, 2020 at 8:47 pm #1250951That’s exactly what I mean, why is there any redirection at all for pagination? Why can’t it load in the same place and just go to more blog posts? Why does it need to reload the entire page? 100% of the users will not interact with this section if they see the page reloading, this is quite old in terms of website design.
Again, is there no way for the blog posts to simply slide in the same section?
October 8, 2020 at 11:16 am #1251373Hi,
Why can’t it load in the same place and just go to more blog posts? Why does it need to reload the entire page?
You are probably looking for asynchronous loading which is not available in the default WordPress pagination.
Again, is there no way for the blog posts to simply slide in the same section?
This is possible with the Masonry element by setting the pagination to the load more button. Or with a third party posts plugin with an AJAX feature.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.