Corrects script and style URLs on subdir installs

By removing get_template_directory_uri() from each call to either the
wp_enqueue_style() or the wp_enqueue_script() function, the URLs to CSS
and JS files will now be correct on subdir installs of WP.
This commit is contained in:
James Costian
2012-06-09 18:12:33 -05:00
parent 39379742fc
commit aef67d23b8

View File

@@ -1,16 +1,16 @@
<?php
function roots_scripts() {
wp_enqueue_style('roots_bootstrap_style', get_template_directory_uri() . '/css/bootstrap.css', false, null);
wp_enqueue_style('roots_bootstrap_style', '/css/bootstrap.css', false, null);
if (current_theme_supports('bootstrap-responsive')) {
wp_enqueue_style('roots_bootstrap_responsive_style', get_template_directory_uri() . '/css/bootstrap-responsive.css', array('roots_bootstrap_style'), null);
wp_enqueue_style('roots_bootstrap_responsive_style', '/css/bootstrap-responsive.css', array('roots_bootstrap_style'), null);
}
// If you're not using Bootstrap, include H5BP's style.css:
// wp_enqueue_style('roots_style', get_template_directory_uri() . '/css/style.css', false, null);
// wp_enqueue_style('roots_style', '/css/style.css', false, null);
wp_enqueue_style('roots_app_style', get_template_directory_uri() . '/css/app.css', false, null);
wp_enqueue_style('roots_app_style', '/css/app.css', false, null);
if (is_child_theme()) {
wp_enqueue_style('roots_child_style', get_stylesheet_uri());
@@ -25,8 +25,8 @@ function roots_scripts() {
wp_enqueue_script('comment-reply');
}
wp_register_script('roots_plugins', get_template_directory_uri() . '/js/plugins.js', false, null, false);
wp_register_script('roots_main', get_template_directory_uri() . '/js/main.js', false, null, false);
wp_register_script('roots_plugins', '/js/plugins.js', false, null, false);
wp_register_script('roots_main', '/js/main.js', false, null, false);
wp_enqueue_script('roots_plugins');
wp_enqueue_script('roots_main');
}