WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using supersized full slider for my themes, but it need all the script and stylesheet gets enqueued before wp_head. So it becomes the part of the header.

Now whenever I use the header template (which is essential) Supersized also get included in all pages. I want to use it in front and home page only. I have a default home page for sliders only.

share|improve this question

migrated from stackoverflow.com Sep 30 '12 at 22:38

This question came from our site for professional and enthusiast programmers.

up vote 0 down vote accepted

Well first of all it depends how you are enqueing your other scripts but make sure you dont add them before the jQuery library itself has been included.

There is nothing stopping you using conditional code in header.php to add scripts depending on the page that is loading, or even the template, category etc;


if ( is_home() || is_front_page() ) { ?>

// add your scripts in normal way

<?php } ?>
share|improve this answer
Thanks McNab for your valuable reply. Just going to try it in my header template, whether supersized slider displays on my Home page only and not on all other pages including portfolio and blog even after using the header template on all those pages. – user1706335 Sep 30 '12 at 6:09
It works great. – user1706335 Sep 30 '12 at 6:39
Excellent! Don't forget to accept the answer then :) meta.stackexchange.com/questions/5234/… – rabmcnab Sep 30 '12 at 7:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.