Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
1  
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
add comment

2 Answers 2

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
add comment
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).

            <p>
                <?php
                    $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; ?>
            </p>
share|improve this answer
add comment

Your Answer

 
discard

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.