Login menu button

Discussion in 'Subscribely v2 WordPress Theme' started by bgp_11, Dec 11, 2013.

Thread Status:
Not open for further replies.
  1. bgp_11

    bgp_11 New Member

    Joined:
    Nov 1, 2013
    Messages:
    9
    Likes Received:
    1
    Hello,

    Im about to launch my video subscription site using the subscribely theme. Works really well for me... however, when the user is logged in where do they go to log off. I need to know how I can change the menu button to log out after users log in. Any help is greatly appreciated.

    Bill
     
  2. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello,

    Follow the instruction given below.

    1. Firstly login to you dashboard and then right click on logout text from the right top corner and then copy its link address.

    See the image for reference

    [​IMG]


    2. Go to the Appearance > Menu panel in your dashboard and create the custom menu for logout and paste the link address of logout in the custom menu link section and then click on the add to menu button.

    See the image for reference.

    [​IMG]





    This will solve your issue.
     
  3. bgp_11

    bgp_11 New Member

    Joined:
    Nov 1, 2013
    Messages:
    9
    Likes Received:
    1
    Piyush,

    This worked great! However, I now have 2 menus and the theme only supports 1. How do I have the menu for logged off users show the login menu and vice versa? Is there an additonal plugin I could use?

    ie-

    Home | About | FAQ's | Contact | Login for logged off users.

    Then when logged in I would like to show:

    Home | About | FAQs | Contact | Log Out for logged in users.


    Thanks for you help.
     
  4. bgp_11

    bgp_11 New Member

    Joined:
    Nov 1, 2013
    Messages:
    9
    Likes Received:
    1
    Piyush,

    I figured it out... I added the following code to the functions.php and used a custom menu.

    add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
    function add_login_logout_link($items, $args) {
    ob_start();
    wp_loginout('index.php');
    $loginoutlink = ob_get_contents();
    ob_end_clean();
    $items .= '<li>'. $loginoutlink .'</li>';
    return $items;
    }
     
    hschurr likes this.
Thread Status:
Not open for further replies.

Share This Page