Load-more button not displaying
-
Yo,
I’m having trouble with the button element not being appended. Tried to console.log-it until I found out that the ajax-load-more script isn’t even loaded. I have no clue of what it could be or what I’ve done that may have gone wrong, since I’ve tried with all default settings mainly. Also when I echo the ‘plugin_url’ in the ‘alm_enqueue_scripts’ function it seems legit.
Any idea of what it could be?
*Hard time explaining the issue since I don’t even know what info to give you.. I just installed it as any other plugin and ran “echo do_shortcode(‘[ajax_load_more]’);” in my category.php -file.
-
Hi,
Sounds like the plugin is not even loaded on the page.
Can you share a URL?Also,
echo do_shortcode('[ajax_load_more]');won’t work on the category pages unless use pass in the category name.Well, the plugin is loaded. But the ajax-load-more script is not. Unfortunately it’s just on my localhost right now, so I can’t share an URL with you.
Do you have any idea of what else it could be? Even tried with wordpress base themes in the index/archive/page -files with no success.
Yea I know, tried that to. This is pretty frustrating. Surely I’m just missing something as usual but no clue what tho’..
I mean, the plugin must be loaded on the page since the container div is visible in the DOM and I can manage to echo/print things from the ajax-load-more.php.
Could be another javascript error causing the ajax to fail.
I’ve noticed that when I change
wp_enqueue_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.js', __FILE__ ), array('jquery'), '1.1', true );to
wp_enqueue_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.js', __FILE__ ), array('jquery'), '1.1', false );the ajax-load-more script is loaded. I’m able to
console.logjust before these lines at the bottom:if($(".ajax-load-more-wrap").length) $(".ajax-load-more-wrap").ajaxloadmore();..but the
ajax-load-more-wrapisn’t recognized even though it’s in the DOM.Could this have anything to do with me using a static front-page and instead of
get_template_part('example')usinginclude(locate_template('example'))?I know it’s hard to get a grip without being able to look at the code so tell me if there’s any other info I could give you to make it easier for you to possibly help me.
Alright, forget everything I just wrote. I went full retard.. Been way too long without any wordpress development. I forget the
wp_footer();-tag and I deserve a great round of applause.
The topic ‘Load-more button not displaying’ is closed to new replies.