wp_list_bookmarks display

I have a question about code on wordpress: I am trying to use code wp_list_bookmarks to list my featured communities that I have setup in “links categories.” I want to be able to separate each link like the following:

San Diego | La Jolla | Rancho Santa Fe | Del Mar

Read More

I am currently using: <?php wp_list_bookmarks('title_li=&category_before=&category_after=&category=21'); ?>

It does work, but displays like this:

  • San Diego
  • La Jolla
  • Rancho Santa Fe
  • Del Mar

Again, I want this:

San Diego | La Jolla | Rancho Santa Fe | Del Mar

Any code recommendations?

Related posts

Leave a Reply

1 comment

  1. Not extremely elegant, but should work…

    $sep = " | ";
    $args = array(
        'before'=>'',
        'after'=>$sep,
        'category_after'=>'',
        'category_before'=>'',
        'title_li'=>'',
        'echo'=>0     //return the string, don't echo
    );
    $str = wp_list_bookmarks($args);
    //chop off the last separator...
    $str = substr($str, 0, strlen($str) - strlen($sep));
    echo $str;
    

    EDIT —
    I added before and after to the $args array — these are actually what _walk_bookmarks() uses before and after each link.