153 posts
    Has been part of the Envato Community for over 1 year Has sold $1,000+ on Envato Market Sells items exclusively on Envato Market
wpminima says

We used this tutorial: http://www.problogdesign.com/wordpress/load-next-wordpress-posts-with-ajax/ to learn more about a “load more posts” button and how to implement it.

We got it to work beautifully but there is a slight issue. When we have a custom post format with a gallery (flexslider) on the second page (e.g. the page that gets loaded) and we press the load more posts the flexslider doesn’t get loaded.

We’re sure this is something that can be fixed relatively easy but we’re just looking over it! :)

Thanks in advance!

3220 posts
    Has sold $5,000+ on Envato Market Has collected 10+ items on Envato Market Located in United States Has been part of the Envato Community for over 4 years
+1 more
organicbee says

You probably want to switch to something like infinite scroll(you can have a load more post button) but it has a callback for js

2445 posts
    Has referred 100+ members Has sold $100+ on Envato Market Has been a beta tester for an Envato feature Has collected 10+ items on Envato Market
+3 more
digitalimpact says

Run Flexslider in the callback function of load() :

$('.pbd-alp-placeholder-'+ pageNum).load(nextLink + ' .post',
    function() {
               // Run Flexslider here

        // Update page number and nextLink.
        pageNum++;
        nextLink = nextLink.replace(/\/page\/[0-9]?/, '/page/'+ pageNum);

        // Add a new placeholder, for when user clicks again.
        $('#pbd-alp-load-posts')
            .before('<div class="pbd-alp-placeholder-'+ pageNum +'" />')

        // Update the button message.
        if(pageNum <= max) {
            $('#pbd-alp-load-posts a').text('Load More Posts');
        } else {
            $('#pbd-alp-load-posts a').text('No more posts to load.');
        }
    }
);
153 posts
    Has been part of the Envato Community for over 1 year Has sold $1,000+ on Envato Market Sells items exclusively on Envato Market
wpminima says

Run Flexslider in the callback function of load() :
$('.pbd-alp-placeholder-'+ pageNum).load(nextLink + ' .post',
    function() {
               // Run Flexslider here

        // Update page number and nextLink.
        pageNum++;
        nextLink = nextLink.replace(/\/page\/[0-9]?/, '/page/'+ pageNum);

        // Add a new placeholder, for when user clicks again.
        $('#pbd-alp-load-posts')
            .before('<div class="pbd-alp-placeholder-'+ pageNum +'" />')

        // Update the button message.
        if(pageNum <= max) {
            $('#pbd-alp-load-posts a').text('Load More Posts');
        } else {
            $('#pbd-alp-load-posts a').text('No more posts to load.');
        }
    }
);

Thank you so much Digitalimpact!! We owe you one :)

2445 posts
    Has referred 100+ members Has sold $100+ on Envato Market Has been a beta tester for an Envato feature Has collected 10+ items on Envato Market
+3 more
digitalimpact says

Thank you so much Digitalimpact!! We owe you one :)

No problem buddy, glad to have helped :)

by
by
by
by
by
by