• Resolved careys7

    (@careys7)


    I’m trying to get separators between a horizontal menu (done with CSS) that displays each child pages in the current branch.
    How do I get separators between the menu items and not just after.

    Eg:

    Home | Links | Downloads | Contact

    Is what I want to achieve.
    Here is the code that I’m using:

    <?php if($post->post_parent)
    $children = wp_list_pages("title_li=&amp;child_of=".$post->post_parent."&amp;echo=0"); else
    $children = wp_list_pages("title_li=&amp;child_of=".$post->ID."&amp;echo=0");
    if ($children) { ?>
    <div class="submenu">
    <ul id="subnav">
    <?php echo $children; ?>
    </ul>
    <?php } else { ?>
    <?php } ?>
    </div>

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The code isn’t going to matter. This is a CSS thing. All you need to do is set the li properties to have a border-left, and then whatever is first in the list will have a class (“page-item-ID” – ID being the ID of the Page). Just set that one to not have a border.

    Thread Starter careys7

    (@careys7)

    Can’t believe I didn’t think of that.
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Putting seperators between menu items’ is closed to new replies.