Hello,
I would like to add a login/logout area to my top bar. Can you help with this? or direct me to where this has been explained before maybe? I am using Church Demo
thanks in advance,
Giolla
Hello,
I would like to add a login/logout area to my top bar. Can you help with this? or direct me to where this has been explained before maybe? I am using Church Demo
thanks in advance,
Giolla
Hi Giolla,
Thank you for reaching out to us. For a simplest solution, you can add the following HTML markup in your Theme Options > Header > Miscellaneous > Topbar Content
<a href="/wp-admin/" class="wp-login-url"><i class="x-icon-key" data-x-icon=""></i> Log In </a>
<a href="/wp-login.php?action=logout" class="wp-logout-url"><i class="x-icon-sign-out" data-x-icon=""></i> Log Out </a>
If the links don’t work then you use the full URLs i.e http://your-domain.com/wp-login.php?action=logout
. This will add the Login / Logout buttons in your Topbar. However you can use a third party plugin for this as well, please see https://wordpress.org/plugins/login-logout-shortcode/ you can paste the shortcode in the Topbar Content.
For this you need to enable the shortcodes in the Topbar, please add the following code in your child theme’s functions.php file:
add_filter('x_option_x_topbar_content', 'top_bar_content_shortcode');
function top_bar_content_shortcode ( $content ) {
return do_shortcode ( $content );
}
Hope this helps!
Thanks for for prompt reply. Support is really excellent!!
I did it and it put the log in and log out directly beside the text I have written on top left. Is there a way to put it further to the right as seen with arrow on attached image? Also is it possible to have a smart one where the login disappears when logged in? and the log out only appears when your logged in?
thanks
Giolla
Hello @Giolla,
You have added the login in the menu. It should be added in your topbar content in X > Theme Options > Header > Miscellaneous > Topbar Content.
You may alter the contents of your topbar content adding this shortcode:
<span class="right">[login-logout text_to_login="Login" text_to_logout="Logout" class="" redirect=""]</span>
This will position the login/logout link to the right of the topbar content. If this does not help, please provide us access to your site so that we can check it.
Regards.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.