Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Including extra CSS/JS to header page level instead of new template
#4
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.

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 } ?>
My Github Repos: Github
Website: DigiMute
Reply


Messages In This Thread
Including extra CSS/JS to header page level instead of new template - by n00dles101 - 2012-03-02, 01:32:47



Users browsing this thread: 1 Guest(s)