CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
JavaScript Jungle
Different JS files for different pages
aaronheine
Permalink to comment
#
September 2010
I will be having different JQuery plugins on lots of different pages of a word press install.
I don't want to place all the plugins into the header because I don't want to load them all for pages that don't need them.
Is there a way to load the JS plugin for just that page?
Thanks
Luminated
Permalink to comment
#
September 2010
You will need to configure a different header.php for each page that you want a unique header on. See this page, third example down:
http://www.ruhanirabin.com/different-headers-in-different-categories-and-pages-wordpress/
So instead of 'is_category' though, you would use 'is_page'. Wordpress Conditionals are the way to go for this:
http://codex.wordpress.org/Conditional_Tags
aaronheine
Permalink to comment
#
September 2010
Thanks, I think that is just what I need.
Add a Comment
I don't want to place all the plugins into the header because I don't want to load them all for pages that don't need them.
Is there a way to load the JS plugin for just that page?
Thanks
http://www.ruhanirabin.com/different-headers-in-different-categories-and-pages-wordpress/
So instead of 'is_category' though, you would use 'is_page'. Wordpress Conditionals are the way to go for this:
http://codex.wordpress.org/Conditional_Tags