WRITTEN BY

ntechi

VN:F [1.9.22_1171]
Rating: 4.7/5 (3 votes cast)

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 ) {
   extract(shortcode_atts(array(
       '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

WordPress Bloginfo Shortcode, 4.7 out of 5 based on 3 ratings