Posts: 4
Threads: 1
Joined: Dec 2014
2014-12-29, 10:42:49
I'm trying to include, i.e. fetch two .js in Cardinal Theme because of making a responsive menu. I've put the two rows at the end of template.php before </body> tag, but I can't get script to load (work):
Code:
<script src="<?php get_theme_url(); ?>/js/jquery-1.7.2.min.js"></script>
<script src="<?php get_theme_url(); ?>/js/script.js"></script>
Is there a trick or do something wrong?
Thnx!
Posts: 4
Threads: 1
Joined: Dec 2014
2014-12-29, 11:34:20
(This post was last modified: 2014-12-29, 11:35:40 by gordan.)
Also, I've just find a solution... The js include code is correct, but it must be written before the last part of code in template.php, ... see below (I still don't know why, what's the reason?):
Code:
<div id="sidebar">
<div class="section">
<?php get_i18n_component('sidebar'); ?>
</div>
<div class="section credits">
<p><?php echo date('Y'); ?> - <strong><?php get_site_name(); ?></strong></p>
<p>
Cardinal Theme by <a href="http://www.cagintranet.com" >Cagintranet</a><br />
<?php get_site_credits(); ?>
</p>
</div>
</div>
Posts: 47
Threads: 4
Joined: Aug 2014
(2014-12-29, 10:42:49)gordan Wrote: I'm trying to include, i.e. fetch two .js in Cardinal Theme because of making a responsive menu. I've put the two rows at the end of template.php before </body> tag, but I can't get script to load (work):
Code:
<script src="<?php get_theme_url(); ?>/js/jquery-1.7.2.min.js"></script>
<script src="<?php get_theme_url(); ?>/js/script.js"></script>
Is there a trick or do something wrong?
Thnx!
these lines seem okay.
the problem may be with the paths (the scripts in must be '/themes/Cardinal/js/'), or there might be some javascript error (check the console log)
Posts: 210
Threads: 15
Joined: Feb 2013
maybe you have a .htaccess file in folder with
"Denny from all" if yes.. change it for "Allow from all"
maybe the selected theme is not a cardinal theme.. if yes.. try do it from
<script src="<?php get_theme_url(); ?>/js/jquery-1.7.2.min.js"></script>
to:
<script src="<?php get_site_url(); ?>themes/Cardinal/js/jquery-1.7.2.min.js"></script>
Posts: 4
Threads: 1
Joined: Dec 2014
Thank you for the response... it was problem in sidebar content.