Articles of infinite scroll

Jetpack Infinite scroll conflicting with theme's pre_get_posts custom posts_per_page

I have the current function on my theme using pre_get_posts, currently right at the bottom of my theme’s functions.php file: function mytheme_portfolio_archive_pages( $query ) { if ( is_admin() || ! $query->is_main_query() ) return; if ( is_post_type_archive( ‘mytheme_portfolio’ ) ) { // Display 20 posts for a custom post type called ‘mytheme_portfolio’ $query->set( ‘posts_per_page’, 20 ); […]

Custom Loop and Infinite Scroll

I am using customized version of _s theme where I have Product CPT. In the following files, I need to use Infinite scroll (provided by Jetpack) – archive-products.php taxonomy-[tax-name].php home.php archive.php Now, the problem is most of these templates use custom loop (using WP_Query which ends with pagination after while()). I have used following code […]

Isotope with Infinite Scroll

Using Jetpack Infinite Scroll & Isotope (Masonry). I am facing an issue where after every new ajaxed set of posts, I need to destroy and then build isotope layout. If I don’t go with this approach the new set of posts loaded by infinite scroll each time are not treated by isotope layout as its […]

Add Infinite Scroll to Ajax Loaded Category Query

Update: This has been resolved. See update below. Following a few different online tutorials, I’ve managed to create a function to modify my post display via Ajax based on a category selected from a drop-down menu. I’d now like to add Infinite Scroll to the Ajax loaded content, and I can’t seem to figure out […]

Jetpack infinite scroll render – make different depending on post type?

I am currently working on a theme which has two post types – one is the normal “posts” post type, and the other is for portfolio posts – “mytheme_portfolio”. I am using JetPack’s infinite scroll to render new posts, as follows: function mytheme_render_infinite_scroll() { while ( have_posts() ) : the_post(); get_template_part( ‘content’, ‘archive-portfolio’ ); endwhile; […]

Adding LazyLoad and InfiniteScroll to WordPress Theme

I would like to add both the LazyLoad and InfiniteScroll jQuery plugins to my WordPress Theme. They both work well when used by themselves, but when i use them together the LazyLoad Plugin doesn’t fire when loading the next page. As far as i understand this is because LazyLoad doesn’t fire all the JavaScripts that […]

Pagination/infinite scroll with WP_Query and multiple loops

I need that the main page of my site have 3 columns: – The first having the 5 most viewed posts; – The second with the next 5 most viewed posts; – The third with the most recent posts. I don’t want the posts to be never repeated in the same column or another column, […]