Created
April 16, 2014 19:52
-
-
Save rickrduncan/10926106 to your computer and use it in GitHub Desktop.
A shortcode to output your child theme URL to be used in Posts, Pages and/or Widgets.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
//* Get path to our child theme folder | |
//* Useage: [theme-url] | |
function b3m_theme_uri_shortcode( $attrs = array (), $content = '' ) { | |
$theme_uri = is_child_theme() ? get_stylesheet_directory_uri() : get_template_directory_uri(); | |
return $theme_uri; | |
} | |
add_shortcode( 'theme-url', 'b3m_theme_uri_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment