//Display current username
function get_current_username() {
    
	if( is_user_logged_in()){
	$user = wp_get_current_user();
    return  $user->user_login . '<span class="dropDown"></span>';
	}
	else {
	return '<a class="userLogin" href="/sign-in/">Login</a> <a class="SignUp" href="/sign-up/">Add Listing</a>';
	}
}
add_shortcode('theUsername', 'get_current_username');

Leave a Reply

Your email address will not be published.