Appfinite

Premium WordPress Themes for The Genesis Framework

  • Themes
  • Affiliates
  • Blog
  • Tutorials and Resources
  • Forums

Log in/Register in Menu

Home › Community Forums › Vintage Theme Support › Log in/Register in Menu

Tagged: menu

This topic contains 3 replies, has 2 voices, and was last updated by  Wes 3 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • August 22, 2016 at 10:40 pm #19198

    Sandra
    Customer

    Hello
    Is there an easy way to put the login/register meta in the secondary navigation menu? Not versed in PHP but willing to try… Thanks. And what anti-spam plugins would you recommend? Is captcha good enough?

    August 22, 2016 at 10:52 pm #19199

    Wes
    Moderator

    Try this code in your functions.php file –

    
    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;
    }

    This works for the Primary Menu so you’ll have to make adjustments to the code in order for it to work with the Secondary Menu.

    Source – https://gist.github.com/nickcernis/02086c75ee9aa19447e0

    I tested on a regular Primary Menu and it worked perfectly for “Logged in” and “Out” users. You can test to see if your adjustments work for the Secondary Menus as well.

    Currently, I’m not using any Anti Spam plugins so I’m not sure which one would be best at the moment. I’d check the reviews to see what other users are prefer.

    August 23, 2016 at 3:03 am #19203

    Sandra
    Customer

    Thanks! That worked out nicely… Do you know how I can customise the dashboard? Right now the Askimet and spam blocks are showing up which i rather not…

    August 24, 2016 at 8:59 pm #19237

    Wes
    Moderator

    I’ve never done it before, but I did see there are some plugins out there that allow you to customize it. I just Googled “How to customize Dashboard” and a few showed up.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Search Forums

Affiliate Program

Looking to earn some money? Join our Affiliate program and earn 35% of every sale you refer. Top referrers earn 40-50%.

Join Now →

The Genesis Framework

All of our themes are designed for the Genesis Framework. You will need to purchase Genesis in order to use any of our themes.

Purchase Genesis

Hire a Web Developer

Need help setting up or customizing your website?

Contact Us →

Recent Posts

  • Ambition Theme
  • Get all of our Themes at 50% off! (Limited Offer)
  • Follow Me 2.0
  • Aspire Theme
  • Buy One Genesis Theme, Get Another One FREE! (Limited Offer)

Search Site

© 2019 Appfinite Shopping Cart Themes My Account Affiliates Support Forums Buy Genesis

Tutorials & Resources Privacy Contact Us Follow Us on Twitter