<?php get_links(21, '<span>', '</span>', ' | ', TRUE, 'url', FALSE); ?> maybe? Have you tried other characters to make sure it’s actually being parsed at all?
Oh … Stupid code. & #124; (without the space)
I have not tried other characters. You have to forgive me, I am very green at PHP and have learned a ton, from people like you, in the past few weeks:
Where do I add | in the code?
<?php get_links(21, '<span>', '</span>', ' | ', TRUE, 'url', FALSE); ?>
Thanks again.
In place of | – It’s the ascii code for it 🙂
Tried it and stays the same. Nothing changes. Any other thoughts?
Put something else in. ANYTHING else 🙂 Like a o or just any character.
Just tried that and few other things. Nothing works. Is my code written correctly?
That’s what I was wondering 😉 Actually get_links is deprecated.
try http://codex.ww.wp.xz.cn/Function_Reference/wp_list_bookmarks instead.
I did see that, but every time I suse the wp_list_bookmarks code, it list each of my links on a separate line vs. they way I have it now.
I’d agree with Ipstenu. Using deprecated functions can cause you a lot of headache.
When using wp_list_bookmarks(), why not float the elements if you need them to be on the same line? What is the HTML that wp_list_bookmarks() is outputting? <li>‘s?
The solution I used incorporated wp_list_bookmarks(). http://ww.wp.xz.cn/support/topic/adding-special-characters-between-bookmark-links-using-wp_list_bookmarks?replies=4#post-1313855
Here’s what happens when I add the following code:
<?php $links = wp_list_bookmarks('title_li=&categorize=0&sort_column=menu_order&echo=0');
$bookmarks = explode('</li>', $links); //create array from string returned by wp_list_bookmarks
array_pop($bookmarks); //pop last element off array
echo implode('<span class="divider"> | </span>', $bookmarks); ?>
Allied Gardens |
Bay Park |
Carmel Valley |
Chula Vista |
Clairemont |
College |
College Grove |
Coronado |
I did try this:
<?php get_links(21, '<span class="divider"> | </span>', ' | ', TRUE, 'url', FALSE); ?>
Works, except it looks like this now (adds pipe before and after and adds description:
| Allied Gardens1Allied Gardens of San Diego County | | Bay Park1Bay Park of San Diego | | Carmel Valley1Carmel Valley of San Diego
Darren, have you tried using CSS to float the <li>‘s inline?
if you explode the string at the </li> position, don’t forget to add the </li> into the implode code as well (the links that you followed to get your code have missed that);
example:
echo implode('<span class="divider"> | </span></li>', $bookmarks); ?>