1. Home
  2. Docs
  3. Attesa PRO
  4. Show WooCommerce login/logout buttons next to main menu

Show WooCommerce login/logout buttons next to main menu

NB: This feature is available only with Attesa PRO plugin.

If you are using WooCommerce plugin on your website and want to show login / logout buttons near the main menu in the header, here’s how:

Go to your WordPress Dashboard under “Appearance-> Customize-> Attesa Theme Options-> WooCommerce Settings” and activate the option called “Show Login/Logout buttons“.

Once this option is activated, the login / logout icons and the user account icon will appear next to the main menu.

When the user is not logged in, only the login / registration icon will appear. When logged in, the icon for the user account and the logout icon will appear.

Using the options, you can customize page links, icons and tooltip text.

Add more entries via child theme

If you need to add additional icons next to the login / logout buttons, you can use the hook attesapro_add_woocommerce_icons_in_header_action within the child theme and use a function like this:

function attesa_child_add_more_woo_buttons() {
	echo '<span class="attesa-woo-additional-item"><a title="Title Example" href="https://attesawp.com"><i class="fas fa-rocket"></i></a></span>';
add_action('attesapro_add_woocommerce_icons_in_header_action', 'attesa_child_add_more_woo_buttons');

If you want the entry to appear only when logged in (or vice versa) you can include the is_user_logged_in() control in the function.