Add a shortcode

This is a simple one.
/**
* Your Blog title
*
*/
function my_blog_title() {
$blogname = get_bloginfo(‘name’);
return ‘<span class=”blog-title”>’ . $blogname . ‘</span>’;
}
add_shortcode(‘blog-title’, ‘my_blog_title’);
Just add this to your functions.php file and …

This is a simple one.

/**
 * Your Blog title
 *
 */
function my_blog_title() {
	$blogname = get_bloginfo('name');
    return '<span class="blog-title">' . $blogname . '</span>';
}		  	
add_shortcode('blog-title', 'my_blog_title');

Just add this to your functions.php file and then add [blog-title] in any post or page and it will return your Blog Title. :)

Comments are closed.