Treehouse: Grow your CSS skills. Land your dream job.

Show different Nav Menu on specific pages wordpress..

  • # April 22, 2012 at 1:12 am

    iv looked around and even found the couple lines of php for this but i still cant peice it together how i need it

    pretty much i have 3 pages, these pages should all display “menu2″ if the visitor is not on any of the 3 particular pages, then they should see “menu1″ i now thats a pretty straight forward bit of code . i think the heat is getting to me, can anyone help me out?

    thank you

    # April 22, 2012 at 7:19 am

    here, i am not sure, but it might help

    # April 22, 2012 at 11:33 am

    You could use two templates for this. Let’s say they are called template1.php and template2.php. Three pages that use menu1 use template1, and set the other pages to use template2.

    I assume you will put the menu in your header. In there, you can then use this code:

    If you’re creating the menus in WordPress, then it would end up something like this:

    # April 22, 2012 at 4:31 pm

    the second method worked perfect thank you! :-D

    just gotta style them now uhg..

    # December 1, 2013 at 6:15 am

    Dear Senff..

    can you tell me where may i put the code in my WP source please ??


    # December 3, 2013 at 3:02 am

    I checked both of method for my page source but second one is work and first one nothing anyway. Please find that error.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.