Categories
Blog

How to add a login and logout menu tab for your WooCommerce enabled DIVI theme

Adding a log in and log out button for a DIVI Woocommerce enabled theme has not been easy to search for a solution.

[et_pb_section bb_built=”1″ _builder_version=”3.23.3″ background_color=”#fbfcfd” z_index_tablet=”500″ box_shadow_horizontal_tablet=”0px” box_shadow_vertical_tablet=”0px” box_shadow_blur_tablet=”40px” box_shadow_spread_tablet=”0px” next_background_color=”#ffffff”][et_pb_row disabled_on=”on|on|” _builder_version=”3.23.3″ min_height=”20px” z_index_tablet=”500″ box_shadow_horizontal_tablet=”0px” box_shadow_vertical_tablet=”0px” box_shadow_blur_tablet=”40px” box_shadow_spread_tablet=”0px”][et_pb_column type=”1_2″][et_pb_image src=”https://websiteforjust200.com/wp-content/uploads/2018/09/financeboard.jpg” _builder_version=”3.23.3″ custom_margin=”-5%|||25%” custom_margin_last_edited=”on|” z_index_tablet=”500″ box_shadow_horizontal_tablet=”0px” box_shadow_vertical_tablet=”0px” box_shadow_blur_tablet=”40px” box_shadow_spread_tablet=”0px” custom_css_main_element=”-webkit-clip-path: circle(50% at 50% 50%);||clip-path: circle(50% at 50% 50%);||width: 75px;||height: 75px;” /][/et_pb_column][et_pb_column type=”1_2″][et_pb_text _builder_version=”3.23.3″ text_font=”Source Sans Pro||||||||” text_text_align=”left” text_text_color=”rgba(0,0,0,0.8)” text_font_size=”18px” header_font=”||||||||” header_text_align=”left” custom_margin=”-3%|||-65%”]

ErnestPH

[/et_pb_text][et_pb_text _builder_version=”3.23.3″ text_font=”Source Sans Pro||||||||” text_text_align=”left” text_text_color=” rgba(0,0,0,0.44)” header_font=”||||||||” header_text_align=”left” custom_margin=”-5%|||-65%”]

Web developer

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row][et_pb_column type=”4_4″][et_pb_post_title _builder_version=”3.23.3″ text_orientation=”center” text_shadow_horizontal_length=”text_shadow_style,%91object Object%93″ text_shadow_horizontal_length_tablet=”0px” text_shadow_vertical_length=”text_shadow_style,%91object Object%93″ text_shadow_vertical_length_tablet=”0px” text_shadow_blur_strength=”text_shadow_style,%91object Object%93″ text_shadow_blur_strength_tablet=”1px” title_text_shadow_horizontal_length=”title_text_shadow_style,%91object Object%93″ title_text_shadow_horizontal_length_tablet=”0px” title_text_shadow_vertical_length=”title_text_shadow_style,%91object Object%93″ title_text_shadow_vertical_length_tablet=”0px” title_text_shadow_blur_strength=”title_text_shadow_style,%91object Object%93″ title_text_shadow_blur_strength_tablet=”1px” meta_text_shadow_horizontal_length=”meta_text_shadow_style,%91object Object%93″ meta_text_shadow_horizontal_length_tablet=”0px” meta_text_shadow_vertical_length=”meta_text_shadow_style,%91object Object%93″ meta_text_shadow_vertical_length_tablet=”0px” meta_text_shadow_blur_strength=”meta_text_shadow_style,%91object Object%93″ meta_text_shadow_blur_strength_tablet=”1px” box_shadow_horizontal_tablet=”0px” box_shadow_vertical_tablet=”0px” box_shadow_blur_tablet=”40px” box_shadow_spread_tablet=”0px” z_index_tablet=”500″ title_font=”Source Sans Pro|600||on|||||” title_font_size=”47px” meta=”off” author=”off” date=”off” title_font_size_tablet=”35px” title_font_size_phone=”30px” title_font_size_last_edited=”on|phone” featured_image=”off” /][/et_pb_column][/et_pb_row][/et_pb_section][et_pb_section bb_built=”1″ fullwidth=”on” specialty=”off” prev_background_color=”#fbfcfd” next_background_color=”#000000″ inner_width=”auto” inner_max_width=”none”][et_pb_fullwidth_image _builder_version=”3.23.3″ src=”https://websiteforjust200.com/wp-content/uploads/2018/10/Screen-Shot-2018-10-31-at-8.15.39-PM.png” box_shadow_horizontal_tablet=”0px” box_shadow_vertical_tablet=”0px” box_shadow_blur_tablet=”40px” box_shadow_spread_tablet=”0px” z_index_tablet=”500″ /][/et_pb_section][et_pb_section bb_built=”1″ admin_label=”Why choose us” _builder_version=”3.22.3″ custom_padding=”0|0px|0|0px|false|false” prev_background_color=”#000000″][et_pb_row custom_padding=”0|0px|0|0px|false|false” _builder_version=”3.22.3″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”][et_pb_column type=”4_4″][et_pb_code _builder_version=”3.23.3″ z_index_tablet=”500″]Home » Blog » How to add a login and logout menu tab for your WooCommerce enabled DIVI theme[/et_pb_code][et_pb_text _builder_version=”3.23.3″ text_font=”Share Tech||||||||” text_text_color=”rgba(0,0,0,0.02)” text_font_size=”100px” text_line_height=”0.2em” header_2_font=”Share Tech||||||||” header_2_font_size=”48px” header_2_line_height=”1.4em” custom_margin=”||30px||false” custom_margin_tablet=”||0px|” custom_margin_last_edited=”on|tablet” text_font_size_tablet=”80px” text_font_size_phone=”60px” text_font_size_last_edited=”on|desktop” header_2_font_size_phone=”36px” header_2_font_size_last_edited=”on|phone”]

Adding a log in and log out button for a DIVI Woocommerce enabled theme has not been easy to search for a solution.

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row custom_padding=”38px|0px|0|0px|false|false” padding_top_2=”120px” padding_2_tablet=”40px|||” padding_2_last_edited=”on|tablet” _builder_version=”3.22.3″][et_pb_column type=”4_4″][et_pb_text _builder_version=”3.23.3″ text_font=”Cardo||||||||” text_font_size=”25px” max_width_last_edited=”off|desktop” text_text_align=”left” text_text_color=”rgba(0,0,0,0.8)” text_font_size_tablet=”19px” text_font_size_phone=”17px” text_font_size_last_edited=”on|phone” text_line_height=”1.8em” text_text_shadow_horizontal_length=”text_text_shadow_style,%91object Object%93″ text_text_shadow_horizontal_length_tablet=”0px” text_text_shadow_vertical_length=”text_text_shadow_style,%91object Object%93″ text_text_shadow_vertical_length_tablet=”0px” text_text_shadow_blur_strength=”text_text_shadow_style,%91object Object%93″ text_text_shadow_blur_strength_tablet=”1px” link_text_shadow_horizontal_length=”link_text_shadow_style,%91object Object%93″ link_text_shadow_horizontal_length_tablet=”0px” link_text_shadow_vertical_length=”link_text_shadow_style,%91object Object%93″ link_text_shadow_vertical_length_tablet=”0px” link_text_shadow_blur_strength=”link_text_shadow_style,%91object Object%93″ link_text_shadow_blur_strength_tablet=”1px” ul_text_shadow_horizontal_length=”ul_text_shadow_style,%91object Object%93″ ul_text_shadow_horizontal_length_tablet=”0px” ul_text_shadow_vertical_length=”ul_text_shadow_style,%91object Object%93″ ul_text_shadow_vertical_length_tablet=”0px” ul_text_shadow_blur_strength=”ul_text_shadow_style,%91object Object%93″ ul_text_shadow_blur_strength_tablet=”1px” ol_text_shadow_horizontal_length=”ol_text_shadow_style,%91object Object%93″ ol_text_shadow_horizontal_length_tablet=”0px” ol_text_shadow_vertical_length=”ol_text_shadow_style,%91object Object%93″ ol_text_shadow_vertical_length_tablet=”0px” ol_text_shadow_blur_strength=”ol_text_shadow_style,%91object Object%93″ ol_text_shadow_blur_strength_tablet=”1px” quote_text_shadow_horizontal_length=”quote_text_shadow_style,%91object Object%93″ quote_text_shadow_horizontal_length_tablet=”0px” quote_text_shadow_vertical_length=”quote_text_shadow_style,%91object Object%93″ quote_text_shadow_vertical_length_tablet=”0px” quote_text_shadow_blur_strength=”quote_text_shadow_style,%91object Object%93″ quote_text_shadow_blur_strength_tablet=”1px” header_text_shadow_horizontal_length=”header_text_shadow_style,%91object Object%93″ header_text_shadow_horizontal_length_tablet=”0px” header_text_shadow_vertical_length=”header_text_shadow_style,%91object Object%93″ header_text_shadow_vertical_length_tablet=”0px” header_text_shadow_blur_strength=”header_text_shadow_style,%91object Object%93″ header_text_shadow_blur_strength_tablet=”1px” header_2_text_shadow_horizontal_length=”header_2_text_shadow_style,%91object Object%93″ header_2_text_shadow_horizontal_length_tablet=”0px” header_2_text_shadow_vertical_length=”header_2_text_shadow_style,%91object Object%93″ header_2_text_shadow_vertical_length_tablet=”0px” header_2_text_shadow_blur_strength=”header_2_text_shadow_style,%91object Object%93″ header_2_text_shadow_blur_strength_tablet=”1px” header_3_text_shadow_horizontal_length=”header_3_text_shadow_style,%91object Object%93″ header_3_text_shadow_horizontal_length_tablet=”0px” header_3_text_shadow_vertical_length=”header_3_text_shadow_style,%91object Object%93″ header_3_text_shadow_vertical_length_tablet=”0px” header_3_text_shadow_blur_strength=”header_3_text_shadow_style,%91object Object%93″ header_3_text_shadow_blur_strength_tablet=”1px” header_4_text_shadow_horizontal_length=”header_4_text_shadow_style,%91object Object%93″ header_4_text_shadow_horizontal_length_tablet=”0px” header_4_text_shadow_vertical_length=”header_4_text_shadow_style,%91object Object%93″ header_4_text_shadow_vertical_length_tablet=”0px” header_4_text_shadow_blur_strength=”header_4_text_shadow_style,%91object Object%93″ header_4_text_shadow_blur_strength_tablet=”1px” header_5_text_shadow_horizontal_length=”header_5_text_shadow_style,%91object Object%93″ header_5_text_shadow_horizontal_length_tablet=”0px” header_5_text_shadow_vertical_length=”header_5_text_shadow_style,%91object Object%93″ header_5_text_shadow_vertical_length_tablet=”0px” header_5_text_shadow_blur_strength=”header_5_text_shadow_style,%91object Object%93″ header_5_text_shadow_blur_strength_tablet=”1px” header_6_text_shadow_horizontal_length=”header_6_text_shadow_style,%91object Object%93″ header_6_text_shadow_horizontal_length_tablet=”0px” header_6_text_shadow_vertical_length=”header_6_text_shadow_style,%91object Object%93″ header_6_text_shadow_vertical_length_tablet=”0px” header_6_text_shadow_blur_strength=”header_6_text_shadow_style,%91object Object%93″ header_6_text_shadow_blur_strength_tablet=”1px” max_width=”800px” custom_margin=”|||10%” box_shadow_horizontal_tablet=”0px” box_shadow_vertical_tablet=”0px” box_shadow_blur_tablet=”40px” box_shadow_spread_tablet=”0px” z_index_tablet=”500″]

There’s seems to be no tutorial for it. Well, I have found one but it proves to be outdated or it’s not working on a DIVI WordPress theme. And I found another generic code for creating a log in and log out button but it’s a general one and not intended for Woo commerce My accounts.

I did a trial and error kinda thing! And after several searches and attempt to make my own, I use the code I found from a website. I just omitted 1 word. When I tested it, it redirect me to Woo commerce’s My account dashboard as soon as I logged in.

So here’s the code I’ve found:

add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);

		function add_login_logout_link($items, $args) {
		        ob_start();
		        wp_loginout('index.php');
		        $loginoutlink = ob_get_contents();
		        ob_end_clean();
		        $items .= '<li>'. $loginoutlink .'</li>';
		    return $items;
		} 





And this is the “word” I omitted -> index.php

And with that updated code, My customers can now log into my Internet Radio Cast on VPS website and immediately redirected to their My account page.

[/et_pb_text][et_pb_text _builder_version=”3.23.3″ text_font=”Cardo||||||||” text_font_size=”25px” max_width_last_edited=”off|desktop” text_text_align=”left” text_text_color=”rgba(0,0,0,0.8)” text_font_size_tablet=”19px” text_font_size_phone=”17px” text_font_size_last_edited=”on|phone” text_line_height=”1.8em” text_text_shadow_horizontal_length=”text_text_shadow_style,%91object Object%93″ text_text_shadow_horizontal_length_tablet=”0px” text_text_shadow_vertical_length=”text_text_shadow_style,%91object Object%93″ text_text_shadow_vertical_length_tablet=”0px” text_text_shadow_blur_strength=”text_text_shadow_style,%91object Object%93″ text_text_shadow_blur_strength_tablet=”1px” link_text_shadow_horizontal_length=”link_text_shadow_style,%91object Object%93″ link_text_shadow_horizontal_length_tablet=”0px” link_text_shadow_vertical_length=”link_text_shadow_style,%91object Object%93″ link_text_shadow_vertical_length_tablet=”0px” link_text_shadow_blur_strength=”link_text_shadow_style,%91object Object%93″ link_text_shadow_blur_strength_tablet=”1px” ul_text_shadow_horizontal_length=”ul_text_shadow_style,%91object Object%93″ ul_text_shadow_horizontal_length_tablet=”0px” ul_text_shadow_vertical_length=”ul_text_shadow_style,%91object Object%93″ ul_text_shadow_vertical_length_tablet=”0px” ul_text_shadow_blur_strength=”ul_text_shadow_style,%91object Object%93″ ul_text_shadow_blur_strength_tablet=”1px” ol_text_shadow_horizontal_length=”ol_text_shadow_style,%91object Object%93″ ol_text_shadow_horizontal_length_tablet=”0px” ol_text_shadow_vertical_length=”ol_text_shadow_style,%91object Object%93″ ol_text_shadow_vertical_length_tablet=”0px” ol_text_shadow_blur_strength=”ol_text_shadow_style,%91object Object%93″ ol_text_shadow_blur_strength_tablet=”1px” quote_text_shadow_horizontal_length=”quote_text_shadow_style,%91object Object%93″ quote_text_shadow_horizontal_length_tablet=”0px” quote_text_shadow_vertical_length=”quote_text_shadow_style,%91object Object%93″ quote_text_shadow_vertical_length_tablet=”0px” quote_text_shadow_blur_strength=”quote_text_shadow_style,%91object Object%93″ quote_text_shadow_blur_strength_tablet=”1px” header_text_shadow_horizontal_length=”header_text_shadow_style,%91object Object%93″ header_text_shadow_horizontal_length_tablet=”0px” header_text_shadow_vertical_length=”header_text_shadow_style,%91object Object%93″ header_text_shadow_vertical_length_tablet=”0px” header_text_shadow_blur_strength=”header_text_shadow_style,%91object Object%93″ header_text_shadow_blur_strength_tablet=”1px” header_2_text_shadow_horizontal_length=”header_2_text_shadow_style,%91object Object%93″ header_2_text_shadow_horizontal_length_tablet=”0px” header_2_text_shadow_vertical_length=”header_2_text_shadow_style,%91object Object%93″ header_2_text_shadow_vertical_length_tablet=”0px” header_2_text_shadow_blur_strength=”header_2_text_shadow_style,%91object Object%93″ header_2_text_shadow_blur_strength_tablet=”1px” header_3_text_shadow_horizontal_length=”header_3_text_shadow_style,%91object Object%93″ header_3_text_shadow_horizontal_length_tablet=”0px” header_3_text_shadow_vertical_length=”header_3_text_shadow_style,%91object Object%93″ header_3_text_shadow_vertical_length_tablet=”0px” header_3_text_shadow_blur_strength=”header_3_text_shadow_style,%91object Object%93″ header_3_text_shadow_blur_strength_tablet=”1px” header_4_text_shadow_horizontal_length=”header_4_text_shadow_style,%91object Object%93″ header_4_text_shadow_horizontal_length_tablet=”0px” header_4_text_shadow_vertical_length=”header_4_text_shadow_style,%91object Object%93″ header_4_text_shadow_vertical_length_tablet=”0px” header_4_text_shadow_blur_strength=”header_4_text_shadow_style,%91object Object%93″ header_4_text_shadow_blur_strength_tablet=”1px” header_5_text_shadow_horizontal_length=”header_5_text_shadow_style,%91object Object%93″ header_5_text_shadow_horizontal_length_tablet=”0px” header_5_text_shadow_vertical_length=”header_5_text_shadow_style,%91object Object%93″ header_5_text_shadow_vertical_length_tablet=”0px” header_5_text_shadow_blur_strength=”header_5_text_shadow_style,%91object Object%93″ header_5_text_shadow_blur_strength_tablet=”1px” header_6_text_shadow_horizontal_length=”header_6_text_shadow_style,%91object Object%93″ header_6_text_shadow_horizontal_length_tablet=”0px” header_6_text_shadow_vertical_length=”header_6_text_shadow_style,%91object Object%93″ header_6_text_shadow_vertical_length_tablet=”0px” header_6_text_shadow_blur_strength=”header_6_text_shadow_style,%91object Object%93″ header_6_text_shadow_blur_strength_tablet=”1px” max_width=”800px” custom_margin=”|||10%” box_shadow_horizontal_tablet=”0px” box_shadow_vertical_tablet=”0px” box_shadow_blur_tablet=”40px” box_shadow_spread_tablet=”0px” z_index_tablet=”500″]

Update: May 27, 2019

I have now use the WooCommerce Login code. To view how I implemented it, head over to this tutorial.

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]

Leave a Reply

Your email address will not be published. Required fields are marked *