WordPress.org

Support

Support » Alpha/Beta » Sidebar Login – cant log out

Sidebar Login – cant log out

Viewing 11 replies - 1 through 11 (of 11 total)
  • Jeremy Clark

    @jeremyclark13

    Member

    2.7 uses a new function that outputs the logout url. Just use this code
    <?php echo wp_logout_url(); ?>

    Morphzan

    @morphzan

    Thanks for the prompt response, Do I just add that code to the anywhere into the sidebar.php file?

    Jeremy Clark

    @jeremyclark13

    Member

    Whereever you would like the link to show up. You actually use the code like this.
    <a href="<?php echo wp_logout_url(); ?>">Logout</a>

    Morphzan

    @morphzan

    I have added that code into the php file.
    It shows two logout buttons which is okay but when i hit the new one i get an error:

    “The requested URL /< was not found on this server.”

    Please forgive my ignorance..Im very new to editing plugins etc….

    Jeremy Clark

    @jeremyclark13

    Member

    Where are you adding the code?

    Morphzan

    @morphzan

    When i look through the file i see:

    <li class=”page_item”>‘.__(‘Dashboard’).’
    <li class=”page_item”>‘.__(‘Profile’).’
    <li class=”page_item”>‘.__(‘Logout’).’

    I add it just after that or in theory you could replace the last one although im probably extremely mistaken

    Jeremy Clark

    @jeremyclark13

    Member

    Is that in a plugin file though. Try putting it directly in your sidebar.php file.

    Morphzan

    @morphzan

    I put in in the sidebar.php but same thing happened
    Is there anyplace in particular i need to put it?

    You need to place the code in “al_template.php” in the “ajax-login” folder.

    Look for this in al_template.php:
    /******* This part is drawn when user IS logged in. *******/

    This is where the code needs to go:
    <a href="<?php echo get_settings('siteurl') . '/wp-login.php?action=logout&amp;redirect_to=' . $_SERVER['REQUEST_URI']; ?>"><?php _e('Logout'); ?></a>

    So now it should look like this:
    <a href="<?php echo wp_logout_url('/wp-login.php?action=logout&amp;redirect_to=' . $_SERVER['REQUEST_URI']); ?>" title="Log out">Log out</a>

    Hope this helps. 😉

    Hi Friends,

    This problem is not big problem 😉

    Use this codes :
    ‘.$usp_language[‘logout’].’

    For all more webmasters İnformation CLICK HERE

    Up to here this is code : )

    <a href="'.wp_logout_url(get_option('siteurl')).'" title="'.$usp_language['logout'].'" >'.$usp_language['logout'].'</a>

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Sidebar Login – cant log out’ is closed to new replies.
Skip to toolbar