Title: No posts are loading
Last modified: August 31, 2016

---

# No posts are loading

 *  [jeromeramone](https://wordpress.org/support/users/jeromeramone/)
 * (@jeromeramone)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/no-posts-are-loading/)
 * I have successfully installed this plug-in in a few websites. This time, I can’t
   get it to load any posts.
 * I have installed the plug-in, including the Repeater add-on. I have created a
   few posts. I am using the default shortcode “[ajax_load_more]” on the page.
 * The “<div id=”ajax-load-more>” tag is being added to the page, as well as an 
   empty
    -  tag… but no posts are loading. I’m not getting any jquery errors.
 * You can look at this url to see it not work:
    [http://dev.metrostlouis.org/about-us/newsroom/](http://dev.metrostlouis.org/about-us/newsroom/)
 * Thanks in advance for any assistance!
 * [https://wordpress.org/plugins/ajax-load-more/](https://wordpress.org/plugins/ajax-load-more/)

Viewing 15 replies - 1 through 15 (of 30 total)

1 [2](https://wordpress.org/support/topic/no-posts-are-loading/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/no-posts-are-loading/page/2/?output_format=md)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150426)
 * Looks like the ajax load more is not loaded.
    Can you make sure you have wp_footer();
   in your footer.php file?
 *  Thread Starter [jeromeramone](https://wordpress.org/support/users/jeromeramone/)
 * (@jeromeramone)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150571)
 * Thanks for the reply – wp_footer() is indeed included in the footer.php file.
 * When I view source, I see this line of code, which seems to have been loaded 
   by the wp_footer() function:
 * <script type=’text/javascript’ src=’[http://dev.metrostlouis.org/wp-includes/js/wp-embed.min.js?ver=4.4.2′></script&gt](http://dev.metrostlouis.org/wp-includes/js/wp-embed.min.js?ver=4.4.2′></script&gt);
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150575)
 * Then im not sure.
    The issue is the ajax-load-more.min.js is not being added 
   to your site.
 *  Thread Starter [jeromeramone](https://wordpress.org/support/users/jeromeramone/)
 * (@jeromeramone)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150576)
 * I’m using the below in my functions.php page to load jquery and a few local js
   files… could that be conflicting somehow?
 * add_action( ‘init’, ‘my_script_enqueuer’ );
    function my_script_enqueuer() { 
   wp_deregister_script(‘jquery’); wp_register_script(‘jquery’, ‘[https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js&#8217](https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js&#8217);,
   false, ‘1.11.0’); wp_enqueue_script(‘jquery’);
 *  wp_deregister_script(‘responsiveslides’);
    wp_register_script(‘responsiveslides’,
   get_bloginfo(“template_url”).’/js/responsiveslides.min.js’, false, ‘1.54’); wp_enqueue_script(‘
   responsiveslides’);
 *  wp_deregister_script(‘floatThead’);
    wp_register_script(‘floatThead’, get_bloginfo(“
   template_url”).’/js/jquery.floatThead.min.js’, false, ‘1.3.2’); wp_enqueue_script(‘
   floatThead’); }
 * Should I just manually add that missing javascript file to the header?
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150577)
 * You are 100% sure wp_footer(); is in your footer.php file?
    That should enqueue
   your alm javascript.
 * You can try it manually if you want.
 *  Thread Starter [jeromeramone](https://wordpress.org/support/users/jeromeramone/)
 * (@jeromeramone)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150578)
 * wp_footer is definitely there. When logged into the admin, I can also see all
   of the wp-admin-bar javascript and html, which are also added by wp_footer.
 * btw – I have very few plug-ins installed, but I deactivated all of them except“
   advanced custom fields” and that didn’t help.
 * Do you know if there is a way to peek into the workings of wp_footer and see 
   where it is breaking down?
 * Adding the following code to my script enqueuing function in functions.php did
   solve the problem and get the plug-in working – but will that be something that
   might break down in the future when I update the plug-in?
 *  wp_deregister_script(‘ajax-load-more’);
    wp_register_script(‘ajax-load-more’,“
   [http://dev.metrostlouis.org/wp-content/plugins/ajax-load-more/core/js/ajax-load-more.min.js&#8221](http://dev.metrostlouis.org/wp-content/plugins/ajax-load-more/core/js/ajax-load-more.min.js&#8221);,
   false, ‘1’); wp_enqueue_script(‘ajax-load-more’);
 * Thanks!
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150579)
 * How are you adding the shortcode?
 *  Thread Starter [jeromeramone](https://wordpress.org/support/users/jeromeramone/)
 * (@jeromeramone)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150580)
 * At first, I tried this code in a custom template file:
    echo(do_shortcode(“[ajax_load_more]”);
 * Then I switched to the default template and just put this in the page content:
   [
   ajax_load_more]
 * Neither worked before I added that javascript file to the header… now they both
   work.
 *  [tobiasmalikowski](https://wordpress.org/support/users/tobiasmalikowski/)
 * (@tobiasmalikowski)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150601)
 * Hi there, just wanted to try your plugin, but I’m facing similar issues.
    Using
   the default shortcode (content editor or in template like jeromeramone) [ajax_load_more]
   and don’t see any output. However the div is inserted into the HTML, but the 
   Script is not loaded (only the css). wp_footer(); does exist in my footer.php
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150602)
 * Sorry to hear you’re having troubles…
 * You are saying the script is injected into your site but nothing is happening?
 * Can you share a link?
 *  [tobiasmalikowski](https://wordpress.org/support/users/tobiasmalikowski/)
 * (@tobiasmalikowski)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150603)
 * Hey dcooney, thanks for the quick reply. I updated my reply, cause i noticed 
   that the css gets included but the js won’t. Unfortunately I can’t share a link
   cause I’m on localhost.
 * How is the shortcode supposed to be implemented? Currently my index.php uses 
   custom shortcodes (similar to your shortcode) to output post from different categories,
   sticky posts, etc.
 * Can you give me an example of an working index.php? But even then I don’t know
   why the JS is not includes :/
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150604)
 * CSS will load in the header (wp_head()), JS should load in the footer (wp_footer()).
 *  [tobiasmalikowski](https://wordpress.org/support/users/tobiasmalikowski/)
 * (@tobiasmalikowski)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150611)
 * Hey dcooney,
 * I’ve included wp_footer(); in my footer.php. I’m using the popular JointsWP as
   base for my theme. Here are the last lines from my footer.php:
 *     ```
       </div> <!-- end .off-canvas-wrapper -->
       		<?php wp_footer(); ?>
       	</body>
       </html> <!-- end page -->
       ```
   
 * So as you can see I’m using it like jeromeramone but no JS is included…
 * Just switched to a default theme Twentyfifteen and the JS gehts included.
    Do
   you have any idea what breaks the JS inclusion?
 * Code of my enqueue script, which breaks the JS inclusion (cause if I remove the
   content of file your JS is loaded):
 *     ```
       <?php
       function site_scripts() {
         global $wp_styles; // Call global $wp_styles variable to add conditional wrapper around ie stylesheet the WordPress way
   
       	// Removes WP version of jQuery
       	wp_deregister_script('jquery');
   
           // Adding scripts file in the footer
           wp_enqueue_script( 'site-js', get_template_directory_uri() . '/assets/js/scripts.min.js', '', '', true );
   
           // Register main stylesheet
           wp_enqueue_style( 'site-css', get_template_directory_uri() . '/assets/css/style.min.css', array(), '', 'all' );
   
           // Comment reply script for threaded comments
           if ( is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) {
             wp_enqueue_script( 'comment-reply' );
           }
       }
       add_action('wp_enqueue_scripts', 'site_scripts', 999);
       ?>
       ```
   
 * Ok found out that “wp_deregister_script(‘jquery’);” causes that issue. JointsWP
   is doing that because Foundation needs a specific jQuery version.
 * How can i make this play nice with your plugin? It depends on jQuery and it looks
   like that the Foundation jQuery gets included later than your plugin JS or something
   like that.
 *  [tobiasmalikowski](https://wordpress.org/support/users/tobiasmalikowski/)
 * (@tobiasmalikowski)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150612)
 * Update:
 * I deregister your script and registered it by myself (without jQuery dependency).
 *     ```
       wp_deregister_script('ajax-load-more');
       wp_register_script( 'ajax-load-more', plugins_url( 'ajax-load-more/core/js/ajax-load-more.min.js' ), '',  '', true );
       ```
   
 * Now I get the following error in the JavaScript console:
    Uncaught ReferenceError:
   alm_localize is not defined
 * JavaScript is included now.
 * Ok looks like that comes from deregistering your script and registering it by
   myself. If i just remove the jQuery dependency in your ajax-load-more.php it 
   is working. But thats not the way to do it right.
 * So how can i register your script correctly by myself without jQuery dependency
   and with the localize settings etc?
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years ago](https://wordpress.org/support/topic/no-posts-are-loading/#post-7150613)
 * Hi Tobias,
    Nice work sorting this out. Can you find the `var alm_localize = {}`
   variable anywhere on your page if you view source?

Viewing 15 replies - 1 through 15 (of 30 total)

1 [2](https://wordpress.org/support/topic/no-posts-are-loading/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/no-posts-are-loading/page/2/?output_format=md)

The topic ‘No posts are loading’ 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/)

 * 30 replies
 * 5 participants
 * Last reply from: [stasponomaryov](https://wordpress.org/support/users/stasponomaryov/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/no-posts-are-loading/page/2/#post-8188894)
 * Status: not resolved