how to use a different menu on a specific page (3 posts)

  1. jjjjjjjjggggggg
    Posted 5 years ago #

    I'm building my own child theme on a blank framework and am calling a main navigation menu in header.php. I need this menu on all of my pages except the main landing page. For my main landing page, I want to use an alternate navigation menu than what is on all the other pages. The main landing page will just be static HTML - no feeds or recent posts.

    How can I do this?

    While I'm at it, is there a way to disable the main footer.php just on the home page too?


  2. mchelles
    Posted 5 years ago #

    You could use conditional tags:

    Basically, you'd write a little php function in your theme so if it is home, it displays your alternate menu, but if it is another page than show the other one. You'd do the same thing for your footer file too, though you'll have to be careful with the footer - you need to make sure you still have your closing php and body tags depending on the theme - you can't just get rid of the footer file entirely!

  3. jjjjjjjjggggggg
    Posted 5 years ago #

    Thanks! Worked great!

Topic Closed

This topic has been closed to new replies.

About this Topic