Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #608596

    I have searched the forum and have seen this topic quite a bit – however, i am not sure if has been implemented in the latest theme or not..
    Basically, i have a portfolio gallery at the bottom of the page, 15 images up, pagination on, and multiple pages of content –
    Is there a way that the images can load when user clicks on the next page – without loading entire page?
    In my case, when users click next page, it loads new page, and then user has to scroll to the very bottom of page.




    There’s no easy way to do that with the element you’re using but you could switch to the Masonry element, it has an option that let’s you place a “Load More” button that loads new entries via Ajax (without reload).



    Is there anyway i could “hardcode” an anchor url to the pagination buttons?
    for instance, Page 2 button would have a link like page/2#gallery instead of just page/2
    That way, when the page reloads, i can have it show the same area of the page.
    Just a thought…



    Try adding this at the very end of your theme / child theme functions.php file:

    function add_custom_script(){
        $(window).load(function() {
            $(".pagination a").each(function(){
               var theLink = $(this).attr("href");
               $(this).attr("href", theLink+"#gallery");
    add_action('wp_footer', 'add_custom_script');



    Perfect! works great!
    thanks so much!


    You are welcome, glad to help :)


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.