I set my wordpress permalink structure to /%postname%/ but now when I go to a page other than the home page (for example if I went to somelink.com/about) I lose all javascript references.
I think this happens because the links to the js files are no longer right as it is in the imaginary folder "about". This is how the js files are referenced in the header.php file.
<script type="text/javascript" src="wp-content/themes/default/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="wp-content/themes/default/js/cufon-yui.js"></script>
<script type="text/javascript" src="wp-content/themes/default/js/Goudy_Bookletter_1911_400.font.js"></script>
<script type="text/javascript">
$(document).ready(function() {
Cufon.replace('h1');
Cufon.replace('h3', {textShadow:'0 1px #fff'});
});
</script>
Am I doing something wrong?
if you are referencing anything in your template files you can use either
1:
<?php bloginfo('url');?>
or 2:
<?php bloginfo('template_url');?>
which would be coded as:
<script type="text/javascript" src="<?php bloginfo('url');?>/wp-content/themes/default/js/jquery-1.4.2.min.js"</script>
or
<script type="text/javascript" src="<?php bloginfo('template_url');?>/js/jquery-1.4.2.min.js"</script>
1: loaded the main site URL; 2: will return the absolute url to your current themes directory,
(which is better for theme development).