Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #394938

    Hi!
    I would like to show the person’s identifying connected in the enfold secondary menu.
    I use the plugin Woo Commerce (2.3.0). I also downloaded WooCommerce Menu Extension (1.1.), But was not able to show the user name. Can I put a code in the menu?
    Best regards,
    Bubarama

    #395354

    Hey Bubarama!

    Are you trying to display the username of whoever is logged in? Your wanting to display this in your secondary menu?

    Go ahead and take a screenshot and highlight what your trying to do so we know for sure.

    Cheers!
    Elliott

    #398441
    This reply has been marked as private.
    #398815

    Hi!

    Add this on functions.php:

    add_action('avia_meta_header', 'ava_get_user');
    function ava_get_user() {
    	if ( is_user_logged_in()) {
    		$user = wp_get_current_user();
    		echo "<div id='header-welcome'>Welcome ". $user->display_name ."</div>";
    	}
    }

    Use the “header-welcome” class to adjust the position of the new container.

    Cheers!
    Ismael

    #400599

    Hi Ismael!

    Thank you for your reply. It works.
    However I am unable to put the text (here “Welcome admin”) on the same line and with the same formatting as the menus.
    How can I do that ?
    Best regards,
    Bubarama

    • This reply was modified 9 years, 10 months ago by Bubarama.
    #400600
    This reply has been marked as private.
    #401536

    Hi!

    can you post a link showing the issue? I can’t see it on your homepage. We need to inspect it to be able to provide you some CSS. However try this code in Quick CSS:

    #header-welcome {
    font-size: 11px;
    color: #3c3c3b;
    }
    

    Best regards,
    Andy

    #401537

    Hey!

    Add this to your custom CSS.

    #header-welcome { top: -10px; left: -200px; position: relative; }
    

    And play around with the top and left values to move it around. If that’s not working then send us a WordPress login and we’ll take a look.

    Regards,
    Elliott

    • This reply was modified 9 years, 10 months ago by Elliott.
    #401590

    Hi Elliot
    I added your code in my custom CSS (on the top of Quick CSS). However the text “welcome admin” is still not at the good place, I know I can change the values to place it but I really would like to include it in the enfold secondary menu. I want integrate it in the menu 2 (ideally between “Mon Compte” and social media icons), with this custom css we just place it and it’s not really integrate. For exemple when i reduce screen format, only “welcome admin” is moving…
    What can I do?
    Cheers!
    Bubarama

    #401594
    This reply has been marked as private.
    #402259

    Hi!

    I added this to your custom CSS.

    #header-welcome {
      position: absolute;
      right: 0;
      top: -10px;
      width: auto;
    }
    .av_secondary_right .sub_menu {
      padding-right: 100px !important;
    }

    It should be in the correct spot now.

    Best regards,
    Elliott

    #405809

    Hi Elliot

    It works !
    Thanks

    Bubarama

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Woo commerce – Display the user name’ is closed to new replies.