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 am trying to add a special character to display a » alongside each menu item in Wordpress.

So for example

About us » Contact us » And so on...

Here's my code

      <li><?php echo $children; echo '»'; ?></li>

I expected this would do the job, but it just puts the » below the list.

Here's the full code

      if($post->post_parent) {
      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      $titlenamer = get_the_title($post->post_parent);

      else {
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      $titlenamer = get_the_title($post->ID);
      if ($children) { ?>

      <h2 class="left_title">
        <?php echo $titlenamer ?>
      <ul class="left_body">

        <li><?php echo $children; echo '»'; ?></li>

share|improve this question
up vote 1 down vote accepted

You can do this in three ways:

1) Use before and after arguments in wp_nav_menu

2) Write a custom walker

3) Use CSS :before or :after pseudo classes to add the character. The character must be in escaped unicode, e.g.:

li:after {
 content: '\00BB';
 padding-right: 5px;

There is more in a similar StackExchange answer

share|improve this answer
Thanks Pieter for the edit. – Matt Radford May 19 '14 at 10:01
great answer -thank you – hyp0thetical May 19 '14 at 14:08

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.