This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

PAGINATION PROBLEM

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21064
    parada1280parada1280
    Participant

    Hello i have an isotopic result with pagination on top and bottom, theproblem is when the user reach bottom and click NEXT the results goes to the secondpage but the user dont notice that, because the results are on the top and the user is in bottom, im trying to do a scroll to top when the NEXT button (on the bottompagination) is licked but i cant find the options, i tryied modifying the code but dont work, any advice?

    <a class="asp_next" href="#primary">
                    <?php echo $_pagination_arrow; ?>
                </a>

    When i put an anchor the pagination dont work, also tyied jquery but dont.
    Help.

    #21073
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Well, there is no option on the back-end to do that, so the only way is using a custom javascript code.

    Try adding this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!

    Please note, that I cannot guarantee this will work in every possible case though.

    #21581
    parada1280parada1280
    Participant

    You cannot access this content.

    #21589
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Try this modification:

    add_action('wp_footer', 'asp_scroll_to_nav_top');
    function asp_scroll_to_nav_top() {
      ?>
      <script>
      jQuery(function($){
        $('.asp_r').on('click touchend', '.asp_navigation *', function(e){
          var stop = $(this).closest('.asp_r').offset().top - 20; 
          if ( $('html').scrollTop() > stop ) { 
            $('html').animate({
                "scrollTop": stop
            }, {
                duration: 500
            });
          }
        });  
      });
      </script>
      <?php
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘PAGINATION PROBLEM’ is closed to new replies.