• Resolved andrewbeck

    (@andrewbeck)


    Hi Darren,

    I am attempting to incorporate your plugin into my own theme, but cannot seem to get it to work right out of the box.

    I’ve installed the plugin, inserted the shortcode, and it generates the container, but not any posts inside it:

    <div id="ajax-load-more" class="ajax-load-more-wrap  grey"><div class="alm-listing " data-repeater="default" data-post-type="post" data-post-format="" data-category="" data-taxonomy="" data-taxonomy-terms="" data-taxonomy-operator="" data-tag="" data-meta-key="" data-meta-value="" data-meta-compare="" data-author="" data-search="" data-order="" data-orderby="" data-exclude="" data-offset="0" data-posts-per-page="5" data-lang="" data-scroll="true" data-max-pages="5"  data-pause="false" data-button-label="Older Posts" data-transition="slide"></div></div>

    I understand I may have to enqueue the script within the functions file of the theme, like so:

    function hisignpost_enqueue_scripts(){
    	wp_enqueue_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.min.js', __FILE__ ), array('jquery'),  '1.1', true );
    	}
    add_action( 'wp_enqueue_scripts', 'hisignpost_enqueue_scripts' );

    …but that doesn’t work either. If I install it on any of the Twentysomething from WordPress it works like a charm, just not on my theme. Am I missing something?

    https://ww.wp.xz.cn/plugins/ajax-load-more/

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

    (@dcooney)

    You shouldn’t need to enqueue the scripts, the plugin handles that.
    There might be a JS error on your page stopping ALM from completing.

    Can you share a link or confirm there are no JS errors?

    Thread Starter andrewbeck

    (@andrewbeck)

    Wow thank you for the quick response! I’m working off a local server, but I uploaded the (unfinished) theme to the client’s site just to illustrate. Here is the URL: http://hissignpost.com/
    (I’m not getting an errors.) It should load at the bottom.

    Plugin Author Darren Cooney

    (@dcooney)

    Right, so it isn’t loading the JS or the localize variables.

    Have you tried it another page, other than the homepage?

    Thread Starter andrewbeck

    (@andrewbeck)

    Right, that is why I figured I needed to enqueue it.

    If you look at this link, I was testing it within a page’s content: http://hissignpost.com/the-church/ And here, on a category archive: http://hissignpost.com/category/blog/

    One note: I tried installing another AJAX-based plugin (SearchWP) and it didn’t work either. But I cannot find the cause.

    Plugin Author Darren Cooney

    (@dcooney)

    your theme must be either missing something or is blocking ajax calls.

    If you bought it, i’d suggest support from the theme author.

    Thread Starter andrewbeck

    (@andrewbeck)

    I was afraid of that… so with some reverse engineering I picked apart the theme and found the issue was a missing hook to admin-ajax. Thanks for looking into it! I think I’ve found my new favorite plugin. ^_^

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

The topic ‘Generates Container but No Posts’ is closed to new replies.