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.
35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
|
|
function roots_scripts() {
|
|
wp_enqueue_style('roots_bootstrap_style', '/css/bootstrap.css', false, null);
|
|
|
|
if (current_theme_supports('bootstrap-responsive')) {
|
|
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', '/css/style.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());
|
|
}
|
|
|
|
if (!is_admin()) {
|
|
wp_deregister_script('jquery');
|
|
wp_register_script('jquery', '', '', '', false);
|
|
}
|
|
|
|
if (is_single() && comments_open() && get_option('thread_comments')) {
|
|
wp_enqueue_script('comment-reply');
|
|
}
|
|
|
|
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');
|
|
}
|
|
|
|
add_action('wp_enqueue_scripts', 'roots_scripts', 100);
|