Title: Only loading 1 post
Last modified: August 21, 2016

---

# Only loading 1 post

 *  Resolved [jasoncigar](https://wordpress.org/support/users/jasoncigar/)
 * (@jasoncigar)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/only-loading-1-post/)
 * I’m having an issue where, no matter what I put in the shortcode, I only get 
   one story to load when pressing the button or auto scroll loading.
 * There are way more stories available to load, yet I always only get one.
 * Here is my code:
 *     ```
       <?php
               echo do_shortcode('[ajax_load_more post_type="post" category="press" offset="4" scroll="false" pause="true" button_label="Load more"]');
        ?>
       ```
   
 * Any thoughts?
 * [https://wordpress.org/plugins/ajax-load-more/](https://wordpress.org/plugins/ajax-load-more/)

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

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/only-loading-1-post/#post-5090223)
 * I’m not really sure… I just tested your exact set up, pause loading and offset
   of posts by category and it’s working as expected for me.
 * What does your repeater look like?
 *  Thread Starter [jasoncigar](https://wordpress.org/support/users/jasoncigar/)
 * (@jasoncigar)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/only-loading-1-post/#post-5090231)
 * Thanks for quick reply!
 * And, the fail was in the repeater. Thanks again.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/only-loading-1-post/#post-5090232)
 * No problem! glad to hear your using the plugin!
 *  Thread Starter [jasoncigar](https://wordpress.org/support/users/jasoncigar/)
 * (@jasoncigar)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/only-loading-1-post/#post-5090235)
 * Ok, found the issue in the repeater:
 * – I have a php function within the repeater that is causing the issue.
 * Are we unable to call a function from within the repeater?
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/only-loading-1-post/#post-5090240)
 * Yea, you should be. What function?
 *  Thread Starter [jasoncigar](https://wordpress.org/support/users/jasoncigar/)
 * (@jasoncigar)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/only-loading-1-post/#post-5090243)
 * from within the repeater:
    `<?php getFBLikes(get_permalink()); ?>`
 * on the page:
 *     ```
       function getFBLikes($theurl) {
       //code blah blah
       }
       ```
   
 * I removed everything within the function (& even the function itself) and the
   repeater still fails. Is there something wrong with the way the function is being
   called?
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/only-loading-1-post/#post-5090244)
 * Looks fine to me… and it works if you remove that function?
    If it’s failing 
   on that function it must be something in their that is doesn’t like. Have you
   tried passing the post id via get_permalink()?
 * Also, is there an error msg at all?

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

The topic ‘Only loading 1 post’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/only-loading-1-post/#post-5090244)
 * Status: resolved