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 creating a custom footer navigation in wordpress. I looked all over the wordpress documentation and still haven't found anything. So, what I'm trying to do is add an "|" in the navigation like this:

Home | Link 1 | Link 2 | Link 3 | Contact

I know there's a way in CSS, but I know this is generated by wordpress so I'm a little stumped on how to do this.

share|improve this question
Are you using wp_nav_menu? Could you please post the code used to display the nav menu? – Jared Feb 24 '12 at 16:12

wp_nav_menu has a $beforeand $after parameters which you can use to add your pipes with.

read more about wp_nav_menu entry at the codex

share|improve this answer
Perfect! Thanks. – blackbull77 Feb 24 '12 at 17:15
up vote 0 down vote accepted

I figured out a way to do this and without using the wp_nav_menu.

Here's the code to do this and hope it might help other (Note: You need to create a menu in the admin panel to have this work).

                    $items = wp_get_nav_menu_items("footer");
                        $count = count($items);
                        $i = 0;
                    foreach($items as $item):
                        $i += 1;
                <a href="<?php echo $item->url; ?>"><?php echo $item->title; ?></a><?php if($i < $count){ echo "<span class='center'>|</span>";} ?>
                <?php endforeach; ?>
share|improve this answer

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.