Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #855010

    dthom
    Participant

    Hi. I have followed the guidance provided in the forum as to how to add Loin/LogOut links to the x-topbar and the solution works – almost. My issue is that when I click on the LogOut link, it takes me to a LogOut confirmation page (see attachment). When I click on the LogOut link on that screen the url does change to show LogOut =”true”, but does not re-direct the user back to the home page (the behavior I am trying to accomplish).

    site is at http://www.mysalus.org

    Am I missing a step?

    Thanks

    #855025

    Zeshan
    Member

    Hi there,

    The reason could be that you are using custom login URL, i.e., /sitelogin. Try changing your logout link to:

    https://mysalus.org/sitelogin?action=logout&redirect_to=https%3A%2F%2Fmysalus.org%2F%3Floggedout%3Dtrue
    

    Thank you!

    #855131

    dthom
    Participant

    Thanks! That code works perfect! One last tweak to this item. The LogOut Link show when logged out. When logged in, it only shows LogOut (perfect). I used the following css in my child theme which did do the proper show/hide before I updated with the above code. Is there a tweak I should make to the below css to get the hide LogOut urls not to show when logged out?

    /* X_Topbar LogIn-LogOut */

    .wp-login-url:before,
    .wp-register-url:before,
    .wp-logout-url:before {
    content: ‘ | ‘;
    }

    .wp-logout-url,
    .logged-in .wp-login-url,
    .logged-in .wp-register-url {
    display: none !important;
    }

    .logged-in .wp-logout-url {
    display: inline !important;
    }

    Thanks so much, you folks are great!

    #855273

    Rupok
    Member

    Hi there,

    Thanks for updating. You need to add the class .wp-logout-url to the logout URL that you didn’t add so the code shouldn’t work.

    You can also try this :

    .logged-in .p-info > a:last-child {
      display: none;
    }

    Hope this helps.

    Cheers!

    #855279

    Thai
    Moderator

    Hi There,

    Please add the following CSS:

    body:not(.logged-in) .x-topbar .p-info a:last-child {
        display: none !important;
    }

    Hope it helps 🙂

    #855332

    dthom
    Participant

    Worked perfect adding class to html.

    Thanks again!

    #855344

    Prasant Rai
    Moderator

    You are most welcome. 🙂