Hi there,
I have created a custom page for one of my categories. At the bottom of the page I have a magazine element that I have set to use pagination. The problem is that when a visitor clicks to advance to the next page, it jumps to the top of the page, but I want it to just jump to the top of the magazine element. Is that possible?
Hey williamslyd,
Sorry for the late reply and thanks for the login. To have the pagination jump to the top of the magazine element instead of the top of the page we will first add a custom ID to the magazine element, newsroom
Then I added this script to the bottom of your child theme functions.php
function custom_pagination_script(){
?>
<script>
(function($){
$(document).ready(function(){
$(".av-masonry-pagination.av-masonry-pagination-pagination nav.pagination a").each(function() {
var $this = $(this);
var _href = $this.attr("href");
$this.attr("href", _href + '#newsroom');
});
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'custom_pagination_script');
This is now working, please check.
Best regards,
Mike
awesome, thanks!
Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.
For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)
Best regards,
Mike