Tagged: portfolio pagination
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.
thanks!
Hi!
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).
Regards,
Josue
Bummer!
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…
Hi,
Try adding this at the very end of your theme / child theme functions.php file:
function add_custom_script(){
?>
<script>
(function($){
$(window).load(function() {
$(".pagination a").each(function(){
var theLink = $(this).attr("href");
$(this).attr("href", theLink+"#gallery");
});
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
Regards,
Josue
Perfect! works great!
thanks so much!
You are welcome, glad to help :)
Regards,
Josue