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 alwerner/83662922d15841f74e2d to your computer and use it in GitHub Desktop.
Save alwerner/83662922d15841f74e2d to your computer and use it in GitHub Desktop.
// 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