Support » Themes and Templates » Defining first/last list item in wp_nav_menu?

  • Resolved SpankMarvin

    (@spankmarvin)


    Hi there

    I am using the wp_nav_menu function to generate my navigation. I will be using specific borders to go between the nav items, and so I need a convient way to define the first or the last list item, so that this can NOT have the border.

    E.g. all list items have a left-hand border, so the first item would need to be told not to have the border…

    I can get this working by directly referring to the id of the list item in question in my stylesheet, but I’d quite like to get this more portable. I could create a variant of the function, I suppose, and tweak that, but am wondering if there’s anything slightly less overkill I can do to solidly number the ids of these list items.

    Any advice would be appreciated.

    Thanks!

    John

Viewing 2 replies - 1 through 2 (of 2 total)
  • Never mind, I just applied a specific style to ul li:first-child to remove the left-hand border. I can live without IE6 support on this feature.

    J

    I was also looking for any solution for the same reason. wp_nav_menu looked limited in this point. This simple CSS aproach looks the best.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Defining first/last list item in wp_nav_menu?’ is closed to new replies.