Leave a Reply

1 comment

  1. The key function to use is wp_logout_url. This function returns the URL for a user to logout.

    You can construct a regular anchor tag / link markup around it and style that as you see fit.

    wp_logout_url takes an optional $redirect argument to send the user to after logout. Here’s a sample with markup and the TLD as redirect:

    echo '<a class="button" title="Log me out" href="' .
            wp_logout_url( get_bloginfo('url') ) .
         ">Logout</a>';