I want to add | (vertical lines) between the page links in the nav menu. What's the easiest way to do this?

  • This would be a CSS question. You can use left/right borders to accomplish this. – Brian Fegter Sep 27 '11 at 0:05

The wp_nav_menu function supports multiple styling parameters, http://codex.wordpress.org/Function_Reference/wp_nav_menu

For instance you can add a $menu_id and then style the CSS for each <li> along the lines of border-right:1px solid; . Another option is to just add a "|" for the $link_after parameter, but you should probably use the ascii HTML entity value for it which is &#124;.

| improve this answer | |
  • Thanks, I want it to be a "|" because I like the way the font I'm using for the nav displays it. However, if I add a $menu_id I get a "|" at the end of the menu, plus it also become part of the link so changes color on rollover. Any ideas? – fxfuture Sep 27 '11 at 4:28
  • Use an background image if you want a specific look. – Wyck Sep 27 '11 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.