Adding Scripts to Theme Designs
Permalink
Hi
We all know we add style sheets like this:
How do we go about adding scripts like this:
DO we need to use a print $this type command?
We all know we add style sheets like this:
<link rel="stylesheet" type="text/css" href="<?php print $this->getStyleSheet('css/bootstrap.css'); ?>" />
How do we go about adding scripts like this:
<script type="text/javascript" src="js/placeholders.min.js"></script> <script type="text/javascript" src="js/scripts.js"></script> <script src="js/jquery-1.9.1.min.js"></script> <!-- IE HTML5 and CSS3 Support for older borwsers --> <script src="js/modernizr.js" type="text/javascript"></script>
DO we need to use a print $this type command?
You should be able to just add that in your theme's top.php or header.pop file. Is there a reason why you're trying to call it up dynamically?
I'm converting over some bootstrap themes, I seem to be getting 404 errors for these scripts in the theme if they are left the way they are...?
Use the below code
You are not suppose to add the jquery library as it will conflict with the core jquery library. So simply remove the below script form your theme.
<script src="js/jquery-1.9.1.min.js"></script>
Rony
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/js/placeholders.min.js"></script> <script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/js/scripts.js"></script> <!-- IE HTML5 and CSS3 Support for older borwsers --> <script src="<?php echo $this->getThemePath(); ?>/js/modernizr.js" type="text/javascript"></script>
You are not suppose to add the jquery library as it will conflict with the core jquery library. So simply remove the below script form your theme.
<script src="js/jquery-1.9.1.min.js"></script>
Rony
Thanks Rony