Pagination and scrolling is messed up when two list queries are on the page
-
This may be difficult to explain so I’ll try to sum up all the conditions of the bug.
1) There is a page that uses a custom template file in the theme. This is not the Beaver Theme. It’s based on Blankslate actually, but this has nothing to do with the problem at hand.
2) Beaver Pro and Themer are installed. No other plugins or conflicts create this issue, it’s just a bug or simple design of how Beaver module works which I’ll explain.
3) Themer has a footer template. In the footer is a Posts module that lists 4 latest posts. Note that this is a simple list of four clickable titles, all meta data is turned off, no image, no pagination, etc.
4) The custom template uses WP_Query() to list out its own content, including pagination. It uses the paginate_links() function to output the page links. For example it will open /page/2 and so on.
The problem:
When you click on page 2, main query in the template loads the second page of data as it should. But also the Beaver Posts module in the footer switches itself to page 2 as well, changing its links. Not only that, but the page auto-scrolls all the way down to the bottom of the page to the footer, because Beaver applies the “.fl-paged-scroll-to” class to the module.So the issue is that when /page/2 opens, Beaver’s Posts module in the footer thinks that page 2 belongs to itself, changes its contents, and scrolls the page to itself too! Even though I’ve turned pagination OFF in the module settings. This is why I think it’s a bug.
The .fl-paged-scroll-to class is applied from the file /plugins/bb-plugin/modules/post-grid/includes/frontend.php on line 16. All it does is check if “get_paged() > 0”. It doesn’t seem to check if the module settings have pagination turned off.
If I set $paged to an empty string, the class doesn’t get applied, and the page doesn’t auto-scroll to the footer, but the content list still changes to new content.What needs to happen is that Beaver needs to honor the setting to disable pagination so that its module content doesn’t change on /page/2, and it doesn’t apply the class and cause the page to scroll to itself either.
- The topic ‘Pagination and scrolling is messed up when two list queries are on the page’ is closed to new replies.