Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enqueue script on all templates, not just index.php #2

Open
adamwalter opened this issue Feb 10, 2014 · 4 comments
Open

Enqueue script on all templates, not just index.php #2

adamwalter opened this issue Feb 10, 2014 · 4 comments

Comments

@adamwalter
Copy link

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.

@ByScripts
Copy link
Owner

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?

@adamwalter
Copy link
Author

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!

@ByScripts
Copy link
Owner

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

@adamwalter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants