WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar Login - cant log out (12 posts)

  1. Morphzan
    Member
    Posted 5 years ago #

    I have installed WP 2.7 and have tried both Ajax Login and Sidebar Login for my users on the front end. On both of them when the logout button is clicked nothing happens

    Any ideas?

  2. Jeremy Clark
    Moderator
    Posted 5 years ago #

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

  3. Morphzan
    Member
    Posted 5 years ago #

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

  4. Jeremy Clark
    Moderator
    Posted 5 years ago #

    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>

  5. Morphzan
    Member
    Posted 5 years ago #

    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....

  6. Jeremy Clark
    Moderator
    Posted 5 years ago #

    Where are you adding the code?

  7. Morphzan
    Member
    Posted 5 years ago #

    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

  8. Jeremy Clark
    Moderator
    Posted 5 years ago #

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

  9. Morphzan
    Member
    Posted 5 years ago #

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

  10. HappyApple
    Member
    Posted 5 years ago #

    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. ;)

  11. aytacengin
    Member
    Posted 4 years ago #

    Hi Friends,

    This problem is not big problem ;)

    Use this codes :
    '.$usp_language['logout'].'

    For all more webmasters ─░nformation CLICK HERE

  12. aytacengin
    Member
    Posted 4 years ago #

    Up to here this is code : )

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags