Login and Logout modifications

This topic contains 4 replies, has 2 voices, and was last updated by  EH 8 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #162526
    #162679

    Paolo
    Site Admin
    Post count: 31206

    Hi Danielle,

    adding the login link that way is wrong, it will remain visible when users are logged in and that’s not good UX. Adding a logout link in the menu (that appears instead of the login link when users are logged in), is not that easy of a task, it requires hooking into the wp nav menu items (all this has nothing to do with our products).

    The login/register page is structured that way, anything different will require a customization.

    This kind of customizations are really beyond support.

    Thanks

    #162780

    EH
    Expired Member
    Post count: 96

    Thanks Paolo,

    I have figured out the login/logout link, I just have to figure out how to restructure the gd-login page.

    Here is the code I used to get the login/logout for anyone else needing it and using genesis.

    
    
    add_filter( 'wp_nav_menu_items', 'sp_add_loginout_link', 10, 2 );
    function sp_add_loginout_link( $items, $args ) {
    	// Change 'primary' to 'secondary' to put the login link in your secondary nav bar
    	if ( $args->theme_location != 'primary' )
    		return $items;
    	if ( is_user_logged_in() ) {
    		$items .= '<li class="menu-item"><a href="'. wp_logout_url() .'">Log Out</a></li>';
    	} else {
    		$items .= '<li class="menu-item"><a href="'. site_url('wp-login.php') .'">Log In</a></li>';
    	}
    	return $items;
    }
    #163483

    EH
    Expired Member
    Post count: 96

    Hi Paolo,

    I’m pretty close to achieving what I first set out to do. I now have a proper login/logout on the site. Thank you for pointing out my error. http://new.electronichouse.com Here is my login page, http://new.electronichouse.com/login

    The last thing I left to do is remove the login section from here, http://new.electronichouse.com/gd-login I see in geodir-signup.php the section that controls that is do_action(‘geodir_signup_forms’); I really like not to hack the core functions of geodirectory. I was hoping maybe you could recommend a filter to remove this section. If not I’ll keep at it, I understand I been asking a ton of customization questions.

    #163489

    EH
    Expired Member
    Post count: 96

    I just saw this page: https://wpgeodirectory.com/docs/customizing-geodirectory-templates/. I’m pretty sure I have what I need now. Thank you

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket