Skip to content

Commit

Permalink
Search in parent theme and child theme directory for stylesheet.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.locallylost.com/themes/hybrid-core/trunk@403 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information
greenshady committed Oct 16, 2010
1 parent 977325b commit 5d7e307
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions extensions/post-stylesheets.php
Expand Up @@ -40,8 +40,14 @@ function post_stylesheets_stylesheet_uri( $stylesheet_uri, $stylesheet_dir_uri )
$stylesheet = get_post_meta( $wp_query->post->ID, $meta_key, true );

/* If a meta value was given and the file exists, set $stylesheet_uri to the new file. */
if ( !empty( $stylesheet ) && file_exists( get_stylesheet_directory() . "/css/{$stylesheet}" ) )
$stylesheet_uri = $stylesheet_dir_uri . "/css/{$stylesheet}";
if ( !empty( $stylesheet ) ) {

if ( file_exists( get_stylesheet_directory() . "/css/{$stylesheet}" ) )
$stylesheet_uri = "{$stylesheet_dir_uri}/css/{$stylesheet}";

elseif ( file_exists( get_template_directory() . "/css/{$stylesheet}" ) )
$stylesheet_uri = get_template_directory_uri() . "/css/{$stylesheet}";
}
}

/* Return the stylesheet URI. */
Expand Down

0 comments on commit 5d7e307

Please sign in to comment.