WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
This would be a CSS question. You can use left/right borders to accomplish this. – Brian Fegter Sep 27 '11 at 0:05
up vote 1 down vote accepted

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;.

share|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 posting your answer, you agree to the privacy policy and terms of service.

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