Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ataylorme/4233626 to your computer and use it in GitHub Desktop.
Save ataylorme/4233626 to your computer and use it in GitHub Desktop.
Replace bloginfo('template_directory') with bloginfo('stylesheet_directory') - Great for child themes
if( !function_exists('replace_template_directory_with_stylesheet_directory')):
function replace_template_directory_with_stylesheet_directory($text, $show){
if( $show == 'template_directory' )
$text = get_bloginfo('stylesheet_directory');
return $text;
}//end replace_template_directory_with_stylesheet_directory
endif; //replace_template_directory_with_stylesheet_directory function does not exist
add_filter('bloginfo_url', 'replace_template_directory_with_stylesheet_directory', 10, 2); //hook replace_template_directory_with_stylesheet_directory function to bloginfo_url info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment