Posted By

planetabhi on 06/11/12


javascript php wordpress

Versions (?)

Load specific JavaScript files in header.php in the homepage only? in WordPress

 / Published in: PHP

In your header.php file:

  1. <?php if(is_front_page()):?>
  2. <?php /*?>your java script code<?php */?>
  3. <script type=”text/javascipt” src=”yourfile.js”></script>
  4. <?php endif; ?>

Report this snippet  

You need to login to post a comment.