Changing sort order for presentation by Jetpack infinite scroll
Changing sort order for presentation by Jetpack infinite scroll
Changing sort order for presentation by Jetpack infinite scroll
The problem lies in the ‘container’ => ‘content’. The container parameter is the core of adding infinite scroll to your theme: it specifies the ID of the HTML element to which infinite scroll should add additional posts to. You need to add ID ( for example: product-wrapper ) to products wrapping element which is going … Read more
Using infinite scroll ajax load more with search parameter
Load MediaPlayerElement after Infinity Scroll loads more posts
This is just one approach. You have the Load More button and once you click that you request for more posts via Ajax. You need to master Ajax in WordPress first and call WP_Query with specific arguments to fit your case. Once you get results via Ajax you need to use JavaScript or JQuery to … Read more
Stand down! I got it with ‘pre_get_posts’: add_action( ‘pre_get_posts’, ‘pre_service_archive’ ); function pre_service_archive() { if( is_post_type_archive( ‘service’ ) ) remove_theme_support( ‘infinite-scroll’ ); }
Your div wrapper is within your while loop, and split by your if clause. This cannot work properly, since your loop will generate up to 14 divs with the id ajax. Put the opening div tag after if ( $the_query->have_posts() ) { and the closing after wp_reset_postdata(); and you should be fine. Edit Are you … Read more
You probably need to define a new loop function for the Custom Post Type to pass to the render parameter. As in the example from https://jetpack.com/support/infinite-scroll/ /** * Add theme support for infinity scroll */ function twenty_ten_infinite_scroll_init() { add_theme_support( ‘infinite-scroll’, array( ‘container’ => ‘content’, ‘render’ => ‘twenty_ten_infinite_scroll_render’, ‘footer’ => ‘wrapper’, ) ); } add_action( ‘after_setup_theme’, … Read more
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
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.