Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter valon1x

    (@valon1x)

    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…

    Plugin Author Darren Cooney

    (@dcooney)

    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.

    Thread Starter valon1x

    (@valon1x)

    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

    Thread Starter valon1x

    (@valon1x)

    $(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

    Plugin Author Darren Cooney

    (@dcooney)

    Ok, so did you solve your issue?

    Thread Starter valon1x

    (@valon1x)

    yes, i removed your plugin and wrote own code…. pity that the plug didn`t help me

    Plugin Author Darren Cooney

    (@dcooney)

    Yea, there was definitely unique with your set up that was causing issue.

    Best of luck with the new script.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Class done’ is closed to new replies.