Support » Fixing WordPress » Adding a menu to a page other than homepage

  • Resolved lawlessvintage


    I am trying to build my first website & am having trouble understanding how to put a menu I created onto a specific page.

    I have read the answers already given and watched youtube vids but still cant get it to sink in. the site is, I dont even think it shows up until bottom of first search page. The page I want the menu on is the Industry Affiliations page and the menu that I made has a bunch of website links on it. thanks

Viewing 15 replies - 1 through 15 (of 24 total)
  • Register the menu in the functions.php.

    Create a custom page template for Industry Affiliations.

    Place the code for the menu in that template where you want the menu to display.

    When in doubt, check the codex first.

    Hi Don,

    Thanks for helping me.

    Do I do the steps above in that exact order?


    I copied & pasted the example in the codex & replaced the their example
    header menu with my websites of interest and this is the error message I got
    Fatal error: Cannot redeclare register_my_menus() (previously declared in /home/lawless/public_html/ in /home/lawless/public_html/ on line 20

    everything is gone.

    all my pages, its all gone. I went back to functions php and took out what I did, but I must have done it wrong because now everything is gone.

    And I DID NOT make a childs theme, I just want to cry.

    It’s not a done deal, yet. We’ve all probably been in the same boat you’re in now and I’ve shed my own tears, but let’s see if we can get you back up and running.

    Your site isn’t gone, it’s just that when you deleted what you had cut and pasted in you probably deleted something extra – it could be as little as a semicolon – and it’s giving you an error. Think of it as a locked door, but the house is still behind the door. Basically, the easiest thing to do is to reinstall your theme which will set everything back the way it was. Then you’ll be able to see you’re content again

    1. Download the theme again and unzip the files onto your computer.

    1. FTP into your site’s files – your webhost will have instructions how to do that so look it up on their support pages if you don’t know how. Often they’ll have a web based FTP program you can use but if not they’ll should suggest some (depends on what OS you’re using)

    2. Once you’re connected via FTP you’ll see all the files that make up WordPress. Find the folder “wp-content” and then the folder “themes”

    3. Replace the “blogolife” folder with the one you just downloaded and unzipped (it will probably ask if you want to replace the folder and you do).

    If all that has worked, you should be able to access your site again. When that’s done, drink a large glass of the beverage of your choice and feel your heart return to a normal pace, then we’ll deal with the menu again, if you’re up to it.

    Don, I am going to go and follow all your directions, Thank You for being so smart & sharing your knowledge with me. Hopefully I can pull this off, I will let you know.

    P.S. was I at least right about the copy & paste idea? but just probably entered some code wrong.


    Hope all goes well. I think you are right about the cut and paste – you likely entered or deleted something important. It’s all part of the growing pains – if I had a dollar for each time I used to have to reinstall themes…

    Good luck!

    I am so glad that drama is over with. Thank You Don, I would not have known how to recover from that. OK, well back to the original problem.

    Can I just copy & paste the code from codex

    function register_my_menus() {
    array( ‘header-menu’ => __( ‘Header Menu’ ) )
    add_action( ‘init’, ‘register_my_menus’ ); instead of the 2 places it says header replace with websites of interest-menu and websites of interest menu ?????????

    I think what happened last time was that your theme already has a function to add menus in functions.php which is why you got the error that it couldn’t register it twice.

    So, look for the already existing register_nav_menus function and just add your new menu to that function. The whole thing should look something like this (the example is just a bit further down on the codex page from which you pulled the code from your last post):

    function register_my_menus() {
          'header-menu' => __( 'Header Menu' ),
          'extra-menu' => __( 'Extra Menu' )
    add_action( 'init', 'register_my_menus' );

    By the way, if you’re not using a text editor to edit your files via ftp, I highly recommend it. The problem with editing files in the WordPress admin is that if you break something you can’t get to the file to fix it because you’ve broken the admin side as well. If you have access to the files over ftp, you can still get in and fix things, or just replace your functions.php file instead of the whole theme. It took me awhile to learn that one when I was starting out!

    so where the word header is, thats where
    i would put my menu title?

    It would be easier to create a menu and add a custom menu widget wouldn’t it?

    Hello, I am finally back after spending all day yesterday trying to figure out filezilla,hostgator,mysql,etc…..MY BRAIN IS FRIED!!!
    I came back here to get the directions again to put a menu on a page & just read webbrewers suggestion. I do have the custom menu widget, but have not used it, again because I could not figure it out. I do remember reading about that being easier, that was the reason I downloaded it in the first place. How how do i set the custom menu widget onto a certain page? it always goes onto the home page.

    Thanks, Karen

    First this assumes you want the menu in the sidebar. If so, there’s a plug in that lets you control what’s shown in the sidebar by page called “Display Widgets”.
    I’d get that installed, then create a new menu in appearance>menus.
    Add the custom menu widget to the sidebar and pick your new menu.
    At the bottom of the widget editor box, you’ll see options to “hide (or show) on checked”.
    If you want the menu on one page, pick “show” and select that page.

    BEAUTIFUL, that worked, thank you. If I want to put it in the body or a left sidebar I assume I just put the custom menu in those spots as well? could it be that easy?


    Wait, I figured it out. I had a slideshow going on the page where I wanted to put the custom menu. I took it out so the menu would show up at the top right hand side of the page. I went back into widgets to see if I could somehow put it back on just the homepage, and now my slideshow ALSO gave me the option of which pages to show/hide. VERY COOL!!!! that must be just from getting that plug in called “display widgets” i hope so, that is going to make EVERYTHING so much easier. I am going to go back and fiddle around with some of the other widgets and see if they now have that same option under them when i place them in the sidebar, I hope so.


Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Adding a menu to a page other than homepage’ is closed to new replies.