• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Primary Menu location

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Primary Menu location

This topic is: resolved

Tagged: custom, login, logout, menu, theme location

  • This topic has 6 replies, 3 voices, and was last updated 8 years ago by ZachScr.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • May 14, 2014 at 1:31 pm #105146
    Saved by the Bell
    Member

    Hello,

    Sure hope this is an easy fix. I am using the Eleven40 Pro theme.

    I meant to delete just one menu item and ended up deleting the entire menu. Now I understand how to remove just one item at a time but when I recreated the menu, named it and asked for it to go to the Primary Menu location (to the right of the banner), it is showing up under the banner instead. The theme shows the default for the Primary Menu location to the right of the banner. I like it there. How do I change this back?

    Thanks,

    Saved by the Bell

    http://www.dancingwiththeson.com/
    May 14, 2014 at 2:59 pm #105154
    David Chu
    Participant

    Hi,
    Many of the new hipster themes have the menu way up in the Header Right widget instead of the standard old spots. You don't even have to necessarily "assign" it, I think. Just do Appearance... Widgets. Look for Custom Menu and drag it into Header Right. Then click on Custom Menu, choose your menu, and Save.

    That should do it. If not, check your docs that they aimed you at when you bought the theme.

    Cheers,
    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    May 14, 2014 at 5:19 pm #105177
    Saved by the Bell
    Member

    Hey David,

    Great! ... but now the menu is in both spots. I thought about deleting in the "Appearance/Menus" but this might delete everything again. However... if this is what I need to do... please advise.

    Thanks!

    Saved by the Bell

    May 14, 2014 at 5:34 pm #105183
    David Chu
    Participant

    Coolness!
    Now I believe all you have to do is go to Appearance.... Menus, WAY up at the top Manage Locations, unselect your Primary one, and save!

    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    May 14, 2014 at 7:06 pm #105196
    Saved by the Bell
    Member

    Dave,

    Oh man, this IS coolness and easier than I thought easy was! So glad to get your help!

    Saved by the Bell

    May 15, 2014 at 7:14 am #105280
    David Chu
    Participant

    Great! The WP menu system is now pretty nice. Even if you do delete a menu, it's not too bad to recreate, unless somebody wanted 100 pages in their menu or something. 🙂

    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    September 8, 2015 at 6:16 pm #164974
    ZachScr
    Member

    Hi there,

    Hopefully this is the right place to ask this:

    I'm trying to add a Login|Logout button to my website's menu (parallax pro). I want the button to say "Logout" when the user is
    logged in, and "login" when they're logged out. I've found a good way to do this by adding custom code to the functions.php file.

    The code that I'm adding looks like this:

    //Add login/logout link to naviagation menu
    function add_login_out_item_to_menu( $items, $args ){
    
    	//change theme location with your them location name
    	if( is_admin() ||  $args->theme_location != 'primary' )
    		return $items; 
    
    	$redirect = ( is_home() ) ? false : get_permalink();
    	if( is_user_logged_in( ) )
    		$link = '<a href="' . wp_logout_url( $redirect ) . '" title="' .  __( 'Logout' ) .'">' . __( 'Logout' ) . '</a>';
    	else  $link = '<a href="' . wp_login_url( $redirect  ) . '" title="' .  __( 'Login' ) .'">' . __( 'Login' ) . '</a>';
    
    	return $items.= '<li id="log-in-out-link" class="menu-item menu-type-link">'. $link . '</li>';
    }add_filter( 'wp_nav_menu_items', 'add_login_out_item_to_menu', 50, 2 );

    Thing is, it only seems to work when the custom menu I'm using is set to "primary navigation menu". Of course if I set it as the primary navigation menu, I end up with two menu locations as discussed earlier in this thread (and the login/out button is only appears on the primary one). So I'd like to add the menu item to the custom menu without making it a "primary navigation menu".

    I think the issue is in the theme location line above but I'm not sure what to target instead of "primary".

    Anyone have any ideas? I feel like I've tried everything.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Primary Menu location’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble