-
AuthorPosts
-
June 16, 2018 at 12:16 pm #973574
Hi,
I want to show a status like “Welcome USERNAME” in the upper right side of header.
I add the following code on header.php and display status. Now how can I show this at right?<?php
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
echo “Welcome $user->display_name”;
}
?>Regards.
June 16, 2018 at 8:09 pm #973730Hey bilgecelik,
You could create a shortcode and place the shortcode in the Enfold Theme Options > Header > Extra Elements > Phone Number or small info text.
Try adding this code to the end of your functions.php file in Appearance > Editor:// Add Shortcode to show user logged in function user_logged_in() { if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); echo 'Welcome ' . $current_user->user_login . " "; }; } add_shortcode( 'user_logged_in', 'user_logged_in' );then add this shortcode to Phone Number or small info text field:
[user_logged_in]Best regards,
MikeJune 16, 2018 at 9:00 pm #973750Hi,
Even though I added this shortcode to phone Number or small info text field with display in top bar at the right choice, “welcome admin” is still at left.
I want to display it at right side of header.Best regards,
June 16, 2018 at 9:05 pm #973751Hi,
Try this code in the General Styling > Quick CSS field:.av_phone_active_right.av_extra_header_active .container { float: right !important; width: 250px !important; }Best regards,
MikeJune 16, 2018 at 10:18 pm #973768Hi,
It’ s ok.
Thanks for your help.Best regards.
June 16, 2018 at 10:27 pm #973774Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
And if there are features that you wish Enfold had, you can request them and vote the requested ones here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘"logged-in" status in header’ is closed to new replies.

