• Resolved xtiana

    (@xtiana)


    Hi all,

    I have two menus on a WP site – one for the home page and another for all of the posts/pages. I need to hand this off eventually so that another (less WP-savvy) team can create their own posts over time – is there a way to set the “post menu” as default for any new ones? I guess I can always teach them to duplicate an existing post each time instead (and edit to reflect the new content), or include setting the menu in their instructions, but I’m trying to make things as easy as possible. I’m pretty new to custom WP development – any advice would be appreciated. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    The menu used is passed as an argument to wp_nav_menu(). You can add logic to this call to use one menu if is_home() is true and otherwise use the other. You can alter your theme template to do this, or use the ‘wp_nav_menu_args’ filter.

    When you alter templates, you should create a child theme to protect your changes. Adding hooks should also be protected. With hooks, a child theme also works, or you can create your own plugin to contain custom code.

    Thread Starter xtiana

    (@xtiana)

    Perfect – this was just the direction I needed. Thanks a ton!

    • This reply was modified 6 years, 12 months ago by xtiana.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Setting a Default Menu for New Posts’ is closed to new replies.