Child theme update: loads roots style.css THEN child theme style.css + some cleanup - fixes #103

This commit is contained in:
Scott Walkinshaw
2011-07-30 13:00:58 -06:00
parent cd297c2f3c
commit 5c5cabb3d7
2 changed files with 7 additions and 4 deletions

View File

@@ -73,7 +73,6 @@ function roots_get_stylesheets() {
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
$template_uri = get_template_directory_uri();
$styles = '';
if ($roots_css_framework === 'blueprint') {
@@ -101,7 +100,12 @@ function roots_get_stylesheets() {
$styles .= "\t<link rel=\"stylesheet\" href=\"" . plugins_url(). "/gravityforms/css/forms.css\">\n";
}
$styles .= stylesheet_link_tag('/style.css', 1);
if (is_child_theme()) {
$styles .= stylesheet_link_tag('/style.css', 1);
$styles .= "\t<link rel=\"stylesheet\" href=\"" . get_stylesheet_uri(). "\">\n";
} else {
$styles .= stylesheet_link_tag('/style.css', 1);
}
if ($roots_css_framework === 'blueprint') {
$styles .= "\t<!--[if lt IE 8]>" . stylesheet_link_tag('/blueprint/ie.css', 0, false) . "<![endif]-->\n";

View File

@@ -1,7 +1,6 @@
<?php
$theme_name = next(explode('/themes/', get_stylesheet_directory()));
$theme_data = get_theme_data(ABSPATH . 'wp-content/themes/' . $theme_name . '/style.css');
// Rewrites DO NOT happen for child themes
// rewrite /wp-content/themes/roots/css/ to /css/
@@ -44,7 +43,7 @@ function roots_clean_plugins($content) {
}
// only use clean urls if the theme isn't a child or an MU (Network) install
if ((!defined('WP_ALLOW_MULTISITE') || (defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE !== true)) && $theme_data['Template'] === '') {
if ((!defined('WP_ALLOW_MULTISITE') || (defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE !== true)) && !is_child_theme()) {
add_action('generate_rewrite_rules', 'roots_add_rewrites');
add_filter('plugins_url', 'roots_clean_plugins');
add_filter('bloginfo', 'roots_clean_assets');