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!

3436 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

2468 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+2 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 :)

2468 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+2 more
digitalimpact says

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

No problem buddy, glad to have helped :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by