• Resolved andresgl

    (@andresgl)


    Hello,

    I’m trying to show the first four post using the shortcode option offset="4" but it’s not working.

    This is the shorcode I have generated:

    <?php
          echo do_shortcode('[ajax_load_more post_type="stories" offset="4" posts_per_page="2" pause="true" scroll="false" container_type="div"]');
        ?>

    The archive page where I paste the code shows only the button to load more posts, when you click on the button, it loads each time 2 post more but the previous 4 post are not showed.

    Hope you can help me.

    Thank you!

    https://wordpress.org/plugins/ajax-load-more/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi andresgl,
    That is what the offset parameter does. It skips that amount of posts specified in the offset.

    What are you looking to do?

    Thread Starter andresgl

    (@andresgl)

    HI dcooney,

    Thanks for your replay.

    I see… I thought that the offset parameter is for show how many post you want to show by default..

    I want to show 4 post by default and under that 4 post the button ‘Show more’.

    Currently doesn’t show any post only the button “Show more”.

    Many Thanks!

    Plugin Author Darren Cooney

    (@dcooney)

    Updated shortcode below. You were pausing the load of posts.

    echo do_shortcode('[ajax_load_more post_type="stories" posts_per_page="4" pause="false" scroll="false" container_type="div"]');

    Thread Starter andresgl

    (@andresgl)

    Thanks a lot dcooney. Your pluging is amazing and you too 🙂

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

The topic ‘Offset option doesn't work’ is closed to new replies.