WordPress.org

Ready to get started?Download WordPress

Forums

Formatting Navigation Menu in _s Theme (2 posts)

  1. ArneRobot
    Member
    Posted 1 year ago #

    Hello,

    I am trying to achieve the following:

    1.)
    I'd like to use the build-in custom menu function of the current WordPress version to generate a menu that looks exactly like this here in my HTML-layout:

    http://www.guerillamedia.org/kunden/sve/960/index.html

    I'd like the main pages to display in the upper row of navigation elements and the sub-menu (which is also generated by grouping these items as a sub-menu in WordPress) in the lower row, changing when the main page changes.

    I have tried a couple of ideas from the web but not to a satisfying result yet. The problem seems to be that the sub-menu is a nested <ul> inside the main navigation <ul>. I didn't manage to seperate them yet.

    The best I have achieved is this:

    http://guerillamedia.org/kunden/wp-test/grafikdesign/editorial-design/

    It doesn't render correctly in iOS (the sub-menu level) and the navigation elements don't align on the left margin , causing problems when I have sub-menu under "KONTAKT for example...

    2.)
    An additional plus would be to have the first level menu item highlighted when an article is displayed on a single article page. For example: highlight "GRAFIKDESIGN" when displaying an article from Grafikdesign > Editorial Design. But I have already found an ok, not too elegant hack for that.

    Any help is appreciated!

    Thank you, Arne / Berlin, Germany

  2. almcr
    Member
    Posted 1 year ago #

    seems to me, you could generate a custom menu of the sub-item menu links and then use that on a second line by totally dropping the main menu items out of that menu.

    if you want a different menu for different pages, then you could use if conditions to display them differently depending on the page being viewed.
    you can use if conditions based on the name of the page being displayed e.g. About, using the is_page() tag.

    Al

Topic Closed

This topic has been closed to new replies.

About this Topic