Using shortcode in header.php template

I have a shortcode that works on my pages, [user_name] and it displays the site owners first & last name. I would like to display that info in my header template so tried do_shortcode but I don’t know what I am doing :slight_smile:


echo do_shortcode( ‘[user_name]’ );


Maybe someone could correct if possible?


Here is code from my shortcode plugin if this helps:

add_shortcode( ‘user_name’ , ‘z_get_current_name’ );

function z_get_current_name( $atts ){

$user_fname = get_the_author_meta(‘user_firstname’:wink:;

$user_lname = get_the_author_meta(‘user_lastname’:wink:;

extract( shortcode_atts( array(

‘text’ => null,

), $atts ) );

return ‘<span class=”lmn_user_info lmn_user_fname”>’ . $text . ” . $user_fname . ‘</span><span class=”lmn_user_lname”> ‘ . $user_lname . ‘</span>’;