2012-03-02, 01:32:47
No need to install a plugin just to do this.
Just put a conditional statement in the header of your template like so: $id is the slug name.
EDIT
Although you should probably use the built in functions to get the slug name, so this will also work.
Just put a conditional statement in the header of your template like so: $id is the slug name.
Code:
<?php if ($id=='index' ){ ?>
<script type="text/javascript" src="<?php get_theme_url(); ?>/js/yourscriptfile.js"></script>
<?php } ?>
EDIT
Although you should probably use the built in functions to get the slug name, so this will also work.
Code:
<?php if(return_page_slug()=='index' ){ ?>
<script type="text/javascript" src="<?php get_theme_url(); ?>/js/yourscriptfile.js"></script>
<?php } ?>