ThemeShaper Forums » Thematic

[closed]

Naming Navigation Menu Items

(6 posts)
  • Started 9 years ago by tcarnell
  • Latest reply from em hr
  • This topic is not resolved
  1. tcarnell
    Member

    Hi all,

    I want to be able to name each of the <li> items in the main navigation so that I can style each one separately.
    I only need this for the top level menu items though, not those nested under them.

    I can see that Thematic places classes in the list item appropriate to its current state (current_page_item, page_item, etc.) but that's not specific enough for my requirements.
    Is there a way to take the name of the page for instance and add it to the list item's class declaration.

    I realise I could install the NAVT plugin to perform this, but I wondered if there is a way through adding a function.

    Thanks in advance for all/any help.

    Tony.

    Posted 9 years ago #
  2. Hi tcarnell-

    Just to clarify Thematic is employing the WordPress function wp_page_menu to build the navigation. It is that function that is responsible for adding the css selectors to the list. Refer to the wp_list_pages page of the codex for more info on this.

    Noting that each list item is given a unique class based on the page-id the selectors are plenty specific for you to style the li's individually. If you look at the markup closely each list item will have a class of page-item-number. The number represents the page-id that was assigned to the page when WordPress first saved it. Just style the list items according to the unique page-item-page_id class and you good to go.

    -Gene

    Posted 9 years ago #
  3. Rose
    Member

    hi - it it some time since i started working on my site and cannot recall how to add more menu tabs in the horozontal navigation bar at the across the top of my site. So far I just have about & contact which link to content. When I add a new page in WP, the title does not show up as a menu item across the top. I am a complete beginner!

    Posted 9 years ago #
  4. Hi Rose -

    Just to check on one thing. Have you hit the "Publish" button or have you just saved the pages as drafts? They wont show up in the nav unless they have been published. If you have "published" them and they are still not appearing in the navigation, then I'm wondering have you made any edits to you child theme's functions.php ? ANd if so can you post them here?

    -Gene

    Posted 9 years ago #
  5. Rose
    Member

    Hi Gene
    Thanks for getting back to me and sorry for the delay. I haven't made any edits to the theme function I don't think and can't actually find where to do this? My site is www.myeventideas.com
    Thanks heaps
    Rose

    Posted 9 years ago #
  6. Rose-

    I'm still wondering if you have actually "Published" the page? My best guess is that you have only saved the pages as "drafts"

    -Gene

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.