WordPress.org

Ready to get started?Download WordPress

Forums

different menu for homepage (3 posts)

  1. davesnothere
    Member
    Posted 1 year ago #

    I've built my site around the Bones theme, and I cannot find anything useful about how to have a different menu for the homepage than all the other pages. The site is simple, less than 10 pages and no sub-nav.

    I'm kinda new to WP, but am comfortable with php if I need to code. However, due to a time crunch, I'd prefer a plugin for this.

    TIA

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Create a unique page template for your home page and add a menu area with this template...all can be researched on the codex...In the long run, you will serve your customers best to learn some site mods as opposed to sluggish plugins...WP is designed to do this work, but not by default (would be too confusing to the click and run crowd)

  3. michael.mariart
    Member
    Posted 1 year ago #

    This is not really a plugin thing, but more of a theme thing. That's were I'd be adding the code anyway as it's a very eays thing to do.

    In the header.php file (depending on your theme, of course) you can add in something like this:

    <?php
      if (is_front_page()) {
        wp_nav_menu (array ("theme_location" => "homepage"));
      }
      else {
        wp_nav_menu (array ("theme_location" => "default"));
      }
    ?>

    You'll also need to register the menu using register_nav_menu() but that's pretty easy to do.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.