-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path wrong when using wp_enqueue_script #114
Comments
I'll probably investigate this further, but the obvious workaround is to just not use wp_enqueue_script. Since you aren't taking advantage of the dependencies, versions, or scripts WordPress knows about, there isn't much reason to use wp_enqueue_script in my opinion. You can just use regular script tags like Roots does: <script src="<?php echo get_template_directory_uri(); ?>/js/libs/modernizr-2.0.6.min.js"></script> |
I'm using Roots Theme in a local installation, and I'm having a problem with the path of the js and css files of installed plugins. For example: link rel='stylesheet' id='wpetss-css' href='http://localhost:8888/my-site/my-site/plugins/wpetss/wpetss.css?ver=3.2.1' type='text/css' media='all'. You can see the duplicated name in the url (my-site), this is how it looks in the html output. Any suggestion to solve this issue? |
there's a bug with the @swalkinshaw is looking into it |
Boolean should be compared strictly
Hi Im using your ROOTS framework 3.2.4, everything has gone great but when I put some javascript files to be loaded last using wp_enqueue_script .
The path for the file has duplicated the basename for example "http://localhost/bollards2u.co.uk/bollards2u.co.uk/js/css3-mediaqueries.js".
This only happens when you use wp_enqueue_script.
header.php
wp_enqueue_script('jquery-tools', 'http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js'); // jQuery Tools JS
wp_enqueue_script('fancybox', get_template_directory_uri().'/js/jquery.fancybox-1.3.4.pack.js', array(), NULL, true); // FancyBox JS
wp_enqueue_script('custom-scripts', get_template_directory_uri().'/js/scripts.js', array(), NULL, true); // Custom JS
wp_enqueue_script('addthis', 'http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e2802c07ba83d25', array(), NULL, true); // AddThis JS
wp_head();
Output HTML
script type='text/javascript' src='http://localhost/bollards2u.co.uk/bollards2u.co.uk/js/css3-mediaqueries.js'></script>
script type='text/javascript' src='http://localhost/bollards2u.co.uk/bollards2u.co.uk/js/jquery.fancybox-1.3.4.pack.js'></script>
script type='text/javascript' src='http://localhost/bollards2u.co.uk/bollards2u.co.uk/js/scripts.js'></script>
script type='text/javascript' src='http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e2802c07ba83d25'></script>
script type='text/javascript' src='http://localhost/bollards2u.co.uk/bollards2u.co.uk/plugins/contact-form-7/jquery.form.js?ver=2.52'></script>
script type='text/javascript' src='http://localhost/bollards2u.co.uk/bollards2u.co.uk/plugins/contact-form-7/scripts.js?ver=2.4.6'></script>
Any small fix for this without hacking your entire code?
The text was updated successfully, but these errors were encountered: