Show secondary menu only on a specific page

  • PinkLetty

    #4903

    Hi All,

    First I want to say thank you for the theme it is great, i am new to WordPress and have been using it for about 2 months now and have learnt a lot just from reading previous posts on this forum. Now I’m a bit stuck and wondered if you could help.

    I am trying to use a secondary menu to display a number of products and I only want this to show up when you select “order online” in the main menu. (I will then remove the drop-downs from this item)

    I have figured out that I can hide the secondary menu for the remaining pages which will then give the effect that I want and have tried to use the CSS code provided in both these previous posts:

    https://forum.graphene-theme.com/graphene-support/hide-menu

    https://forum.graphene-theme.com/graphene-support/how-to-hide-menu-in-certain-pages

    However this does not appear to work for me, it just ends up hiding my whole post.

    My website is currently under construction so please ignore most of the content as this is just my skeleton, I have turned off my splash screen so you can take a look.

    http://lovefromletty.co.uk/

    Also do you know how i could add a widget to the top bar in the right hand corner? i would like to add my shopping cart there (opposite the twitter and RSS feed icons) i have tried to activate a number of Action hooks but haven’t seemed to find the right one.

    I hope Ive given all the info you need.

    Thanks

    Letty

    Mod

    Kenneth John Odle

    #29768
    Quote:
    have learnt a lot just from reading previous posts on this forum

    Thank you for taking the time to search the forum first. There is an amazing amount of information available here.

    Quote:
    However this does not appear to work for me, it just ends up hiding my whole post.

    Please post the code you are using here, between backticks. It is probably something minor.

    As far as I know, there is no way to undo display:none, so you’ll need to add every page that you wish to hide the menu on to that custom CSS. We’ll be able to give better advice when we have your code.

    Quote:
    I have turned off my splash screen so you can take a look.

    Splash screens are a disincentive to potential readers (and in your case, potential customers).

    Quote:
    i could add a widget to the top bar in the right hand corner?

    I’m not on my own computer at the moment, but try the search_box or top_bar action hook widget areas.

    Anonymous

    #29770

    Or you can just write a custom secondary menu function with conditional tags.

    I’m also away from my PC. I even hate to write comments on mobile phone. So I can’t give you the exact code at this moment.

    PinkLetty

    #29771

    Hi Kenneth,

    Many thanks for getting back to me.

    The two codes that i have tried to use are:

    .post-ID1, .post-ID2 #secondary-menu-wrap {
    display: none;
    }

    in my case I used post-2 I only tested one as an example, this is my about page and this just removed the whole speech I have written there. 🙂

    I also tried:

    .postid-118 #secondary-menu-wrap {display:none;}

    Now I’ve typed them both together on here i have come to realise they are the same code 🙂

    I have also just tried

    #secondary-menu-wrap {display:none;}

    without a specific page id, this makes the secondary menu disappear but on all pages which obviously isn’t the effect I’m going for.

    With regard to the splash screen its only up so i can build the site at my own pace, it is no where near ready yet and I like to have everything perfect before I reveal it 😀

    I will try the search bar and top box and let you know if that works out for me.

    Thanks again!

    Letty

    PinkLetty

    #29772

    Hi Prasanna,

    Thanks for your feedback, I would be very interested to find out how I could create custom secondary menu function with conditional tags. I appreciate you guys are busy so I am happy to wait until you have time and have access to your PC when you do please could you point me in the right direction to try this out?

    Thanks

    Letty

    Mod

    Kenneth John Odle

    #29773

    Letty, you’ll need the specific post ID number of the posts/pages you want to hide the menu on. The numbers in the threads you mentioned were specific to other sites.

    This post:

    http://blog.kjodle.net/2012/04/14/target-graphene-action-hook-widgets-by-their-unique-id/

    will show you how to find those post ID numbers. You will probably need them for Prasanna’s function (which I am also keen to see).

    PinkLetty

    #29774

    Hi Ken,

    I have used the specific post ID sorry i just reread my reply and it wasn’t very clear in the example that I gave my post ID is 2.

    When I use this it just removes my post not the menu.

    Once we hear back from Prassana, i will give you more feedback.

    Letty

    Admin

    Syahir Hakim

    #29775

    This will hide the secondary menu in all pages:

    #secondary-menu-wrap {
    display: none;
    }

    And this will display it only on selected pages:

    .page-id-2 #secondary-menu-wrap,
    .page-id-3 #secondary-menu-wrap {
    display: block;
    }
    Mod

    Kenneth John Odle

    #29776
    Quote:
    As far as I know, there is no way to undo display:none,

    I knew as soon as I said that, someone would show us the way.

    Thanks, Syahir. That information will come in useful down the road.

    Anonymous

    #29778

    Yep! Nice tidbit! Thanks.

Viewing 10 posts - 1 through 10 (of 11 total)
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!