1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how to redirect to home page after logout in wp?

Discussion in 'WordPress' started by mtsandeep, Feb 3, 2009.

  1. #1
    I currently have this function for logout in my wordpress blog,

    <?php echo wp_logout_url() ?>

    i want to redirect my users to the home page after logging out. how to do this?
     
    mtsandeep, Feb 3, 2009 IP
  2. maddest_lover

    maddest_lover Guest

    Messages:
    1,110
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    0
    #2
    goto your wp-login.php file and there find commands which says logout function. below them write this function:

    <?php

    header('Location:http://www.yourdomain.com');
    ?>

    and you r done.
     
    maddest_lover, Feb 3, 2009 IP
  3. nik00726

    nik00726 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    There is no need to hack into your wordpress original file.
    Just download and install wp-login-logout plugin from

    http://www.my-php-scripts.net/index.php/Wordpress/login-and-logout-redirection-wordpress-plugin-advanced-php.html

    This plugin manage where to redirect user after login and after logout.:cool:
     
    nik00726, Jul 24, 2011 IP