Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

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

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

1 Answer

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;

<?php

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
add comment

Your Answer

 
discard

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