Archived topic
Error in button "load more"
11 replies · Started by Jesus on November 17, 2020
Good afternoon, when I am on the main page and I click on the "load more" button, it does not load more articles, but it redirects me to the main page at the top.
Hi there,
Any chance you can disable all plugins except GP Premium to eliminate conflicts from other plugins first?
Let me know :)
I have disabled all plugins and the problem has been fixed. So the problem is a plugin that doesn't let the button do its job?
Likely some error from one of your plugins.
You can re-activate them one by one to determine the issue.
I have deactivated all of them one by one, and there is none that makes that error happen, it disappears for a moment, but after time it happens again.
Can you disable all (not one by one) plugins except GP Premium as once for us to take a look?
Hi Leo, I was searching for this very issue.
I'm testing GP Premium on a local host setup with no other plugins. As pointed out by Jesus, I have selected 'infinite scroll' & 'use button to load more posts' in the Blog module.
When I click on '+ More Button', More posts are loaded, but I'm taken back to the top of the page.
If I uncheck 'Smooth scrolling' in Customizer > General, it works as it should.
I would like to keep smooth scrolling for anchor links, but don't want to be sent back to the top when using infinite scroll.
Must be some conflict between the two options.
Thanks.
Hi there,
have you added any snippets to change the behaviour of the smooth scroll ? for example this which applies smooth scroll to every link:
https://docs.generatepress.com/article/generate_smooth_scroll_elements/
Let me know.
Hi David,
Yes I did add that snippet to enable smooth scroll to anchor text links.
Thanks
Using the modified smooth scroll anchor link code solved the problem.
add_filter( 'generate_smooth_scroll_elements', function( $elements ) {
$elements[] = '.entry-content a[href*="#"]';
return $elements;
} );
Infinite Scroll, plus Smooth Scroll activated, now work as they should.
Thanks Leo, and David.
No problem :)