Class done
-
My button doesn`t have class done after i scroll all pages
-
on page where i use wp_query
$latest_blog_posts = new WP_Query( array( ‘paged’ => $paged, ‘page’ => $paged, ‘post_type’ => ‘post’,’posts_per_page’ => 10 ) );echo do_shortcode(‘[ajax_load_more transition=”fade” button_label=””]’);
in admin panel i set 10 posts per_page
And after i scroll all posts. my button doesnt have class done…
Ajax Load More does not require the WP_Query(). That is likely your issue. It also does not rely on your Posts Per Page settings.
Go through the SHortcode Buildeer and build your custom shortcode.
I do not see a bunch of records in the admin still have at least 20 entries, and it does not take them and do not add the class done
$(window).on("scroll", function(e){ var footHeight = $('footer').offset().top; if($(window).scrollTop() + $(window).height() > footHeight) { var height = $('.pagination').offset().top - $('header').height(); var link = $('.wp-pagenavi .nextpostslink').attr('href'); if(link) { $('.loader').removeClass('hidden'); $('.pagination').remove(); $.ajax({ url:link, type:'POST', success:function(data){ var htmlData = $('<div>'); htmlData.html(data); setTimeout(function(){ $('.loader').addClass('hidden'); }, 50); htmlData.find('.blogContent article').each(function (i,el) { $('.loader').before($(el)); }); var pagination = htmlData.find('.pagination'); $('.blogContent').append(pagination); $('html,body').animate({ scrollTop: height }, 300, 'swing'); } }) } } });that is my solution
Ok, so did you solve your issue?
yes, i removed your plugin and wrote own code…. pity that the plug didn`t help me
Yea, there was definitely unique with your set up that was causing issue.
Best of luck with the new script.
The topic ‘Class done’ is closed to new replies.