Aug 8, 2012

Wordpress Bloginfo Shortcode

A small snippet for Wordpress Bloginfo. This will help you to add images directly without giving the entire path. Its a shortcode snippet

function get_bloginfo_shortcode( $atts ) {
'info' => '',
), $atts));
return get_bloginfo($info);
add_shortcode('bloginfo', 'get_bloginfo_shortcode');

Usage :

<img src="[bloginfo info='template_url']/images/logo.jpg" alt="[bloginfo info='name'] logo" />

Now you can easily call your images without giving actual path.

Credits Forrst

No comments :

Post a Comment