Merge pull request #472 from jamescostian/master
Corrected home URL for subdir installs
This commit is contained in:
@@ -61,8 +61,8 @@ function roots_root_relative_url($input) {
|
||||
'!(https?://[^/|"]+)([^"]+)?!',
|
||||
create_function(
|
||||
'$matches',
|
||||
// If full URL is home_url("/"), return a slash for relative root
|
||||
'if (isset($matches[0]) && $matches[0] === home_url("/")) { return "/";' .
|
||||
// If full URL is home_url("/") and this isn't a subdir install, return a slash for relative root
|
||||
'if (isset($matches[0]) && $matches[0] === home_url("/") && str_replace("http://", "", home_url("/", "http"))==$_SERVER["HTTP_HOST"]) { return "/";' .
|
||||
// If domain is equal to home_url("/"), then make URL relative
|
||||
'} elseif (isset($matches[0]) && strpos($matches[0], home_url("/")) !== false) { return $matches[2];' .
|
||||
// If domain is not equal to home_url("/"), do not make external link relative
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user