Support » Fixing WordPress » STRANGE wp_logout_url(get_permalink()); problem

  • Hello,

    I’m having a problem redirecting users to the current page they are viewing when they log out. I have a logout link in the header using this code:

    <li><a href="<?php echo wp_logout_url(get_permalink()); ?>" rel="nofollow" title="<?php _e('Log out'); ?>"><?php _e('Log out'); ?></a></li>

    If I am on a single post or a wordpress page, then wordpress successfullly logs out and returns to these current pages.

    However, if I am on a category listing page, the home page or any other page on the website then wordpress redirect to the first post in the loop on these pages.

    So if I am on a category.php page for mobile phones with all the posts listed in this category, and I log out, it redirects to the first post displayed on the page.

    But it should redirect to the category page? As this is the current page I am on.

    This is very strange, does anyone know what the problem is?

    Thanks for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Can any one help out with this? I haven’t a clue what is up.


    <a href="<?php echo get_settings('siteurl') . '/wp-login.php?action=logout&redirect_to=' . $_SERVER['REQUEST_URI']; ?>">LogOut</a>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘STRANGE wp_logout_url(get_permalink()); problem’ is closed to new replies.