Created
October 31, 2014 19:51
-
-
Save alwerner/83662922d15841f74e2d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// In functions.php. Creates accessible array of bloginfo parameters | |
// http://codex.wordpress.org/Template_Tags/bloginfo | |
function bloginfo_shortcode( $atts ) { | |
extract(shortcode_atts(array( | |
'key' => '', | |
), $atts)); | |
return get_bloginfo($key); | |
} | |
add_shortcode('bloginfo', 'bloginfo_shortcode'); | |
// in Editor | |
<img src="[bloginfo key='template_url']/images/image.jpg" alt="" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment