wordpress-ajax-posts-loader icon indicating copy to clipboard operation
wordpress-ajax-posts-loader copied to clipboard

Enqueue script on all templates, not just index.php

Open adamwalter opened this issue 11 years ago • 4 comments

It seems like the plugin only loads on the main index template. It would be great to have it load on all templates with matching selectors.

adamwalter avatar Feb 10 '14 23:02 adamwalter

The only check which is done when starting the plugin is the "is_single()" return value (to not load the plugin on "single post" pages)

Have you more information about that? On which page do you want to load the plugin?

ByScripts avatar Feb 11 '14 08:02 ByScripts

That's the culprit. It's actually is_singular() which prevents it loading on pages as well. I've changed it to is_single() to fix my problem. Thanks!

adamwalter avatar Feb 11 '14 16:02 adamwalter

I'm not sure to understand. Do I need to change something on the plugin ? Or is it ok ?

ByScripts avatar Feb 11 '14 18:02 ByScripts

If you want the plugin to load on normal pages, you need to change is_singular() to is_single(). The latter will prevent loading only on single posts.

http://codex.wordpress.org/Function_Reference/is_singular http://codex.wordpress.org/Function_Reference/is_single

adamwalter avatar Feb 12 '14 02:02 adamwalter