Isotope with Infinite Scroll

Usually isotope allows appending new items and then just re-layout the masonry again: Somewhere in your JS file you should put the elements you want to append into a variable, e.g. new_elements jQuery(‘.grid’).append(new_elements) .isotope(‘appended’, new_elements) .imagesLoaded( function() { jQuery(‘.grid’).istotope(‘layout’); }); Source: http://isotope.metafizzy.co/methods.html The solution Thanks to @vajrasar for the final touches. When you echo the … Read more

Adding LazyLoad and InfiniteScroll to WordPress Theme

You need to add the callback function in the argument list as part of the function call, rather than as part of the argument object: jQuery( infinite_scroll.contentSelector ).infinitescroll( infinite_scroll, function(){ addLazyLoad() } ); You can remove the function(){ addLazyLoad()} that’s part of the infinite_scroll object (after “contentSelector”:”#content #main”); it’s not going to do anything.

Add Infinite Scroll to Ajax Loaded Category Query

Update … Here’s the Final Code That Worked for Me This may not be perfect, but it seems to be working well for me with no errors. Feel free to add any suggestions for improvement if you have any. JS Code jQuery(document).ready(function($) { var count = 2; jQuery(“#la-chooser”).change(function() { loadArticlebyCat(this.value); }); function loadArticlebyCat(cat){ data = … Read more

Jetpack Infinite scroll conflicting with theme’s pre_get_posts custom posts_per_page

You’ve specified a priority of 1 for your pre_get_posts function here: add_action( ‘pre_get_posts’, ‘mytheme_portfolio_archive_pages’, 1 ); Jetpack doesn’t specify a priority: add_action( ‘pre_get_posts’, array( $this, ‘posts_per_page_query’ ) ); So that gets added with the default priority for add_action, which is 10: $priority (int) (optional) Used to specify the order in which the functions associated with … Read more

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

Replace the above mytheme_render_infinite_scroll function with this: function mytheme_render_infinite_scroll() { while ( have_posts() ) : the_post(); if (‘mytheme_portfolio’ == get_post_type()) : get_template_part( ‘content’, ‘archive-portfolio’ ); else : get_template_part( ‘content’, get_post_format() ); endif; endwhile; }

Custom Loop and Infinite Scroll

I used ‘init’ in the add_action in my own implementation of infinite scroll, try that. add_action( ‘init’, ‘vg_infinite_scroll_init’ ); As to your question about rendering a custom query you would do the following. -Set the render to your function name ‘render’ => ‘your_render_function, -Add your function to call a specified loop template function your_render_function(){ get_template_part( … Read more

WordPress Infinite Scroll without using any plugin

For single article infinite scroll below is the solution single.php <div class=”blog-article-section”> <?php while( have_posts() ): ?> <div class=”blog-article”> <?php if( have_posts() ): the_post(); ?> <h2><?php the_title(); ?></h2> <p><?php the_content(); ?></p> <?php endif; ?> <div class=”pagination-single” > <div class=”next_post_link”><?php previous_post_link( ‘%link’,’Previous Post’ ) ?></div> <div class=”previous_post_link”><?php next_post_link( ‘%link’,’Next Post’ ) ?></div> </div> </div> <?php endwhile; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)