Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1210291

    Dear all,
    I use the magazin element to display various articles. Whenever I click to see more articles, the site reloads and move back to the top of a page, instead of staying at the given position. How can this be resolved?
    Thank you!

    #1211128

    Dear all,
    can anyone give me a hint how to resolve this? I wish to avoid that clicking on more articles, leads to a full restart of the entire page. Thank you!

    #1211575

    Hi,
    Sorry for the late reply and thanks for the link to your site. Unfortunately, this is the correct behavior for the element, but if you use the following script each time the pagination is clicked and the page reloads the page will return to the same area. This will only work on your frontpage “Corporate Updates” element, please let us know if you have other pages that need this.
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_pagination_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
    $(".av-masonry-pagination .pagination a").each(function() {
       var $this = $(this);       
       var _href = $this.attr("href"); 
       $this.attr("href", _href + '#1');
    });
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_pagination_script');

    Best regards,
    Mike

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.