Masonry Append WordPress posts with singleMode

I'm using Masonry on a Wordpress site, to display posts from a custom post type (training_videos).

As all the columns are the same width im using the singleMode = true option. The site is a responsive site using Skeleton, hence why they need to be the same width for uniform display purposes.

I can get the pots to display fine, and the Masonry aspect is all good, but...

...As the training_videos post type has "more than a few" posts in it, I want to be able to only display 6 at a time, with an append button that adds 6 more underneath and so on, until there are no more to add.

This is where I get stuck.

I can't work out how to get it to work!

Here is the JS Masonry call I'm using so far:

script
jQuery(document).ready(function($) {
    $('#masonry').masonry({singleMode: true});
});
/script

'#masonry' being the container the posts sit in

After following the actualy masonry tutorial site, I'm completely stumped!

Thanks

Topic masonry jquery custom-post-types Wordpress

Category Web


It sounds like you need to use the pagination and posts_per_page arguments for your query. More info: http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters

And using another solution to load more posts when the button is clicked. Maybe this will help you in the right direction.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.