How add "separator" in wp_tag_cloud?
I need this "|".
How add "separator" in wp_tag_cloud?
I need this "|".
call the wp_tag_cloud directly, and then use either:
http://codex.wordpress.org/Template_Tags/wp_tag_cloud#Parameters
separator
(string) (optional) The text/space between tags. Note: this parameter was introduced with Version 2.9.
Default: '/n' (whitespace)
or:
<?php $tag_cloud=wp_tag_cloud('smallest=8&largest=18&format=array');
foreach($tag_cloud as $tags) :
echo $tags.' | ';
endforeach; ?>I try call the wp_tag_cloud directly, and then use this parameter, but not work.
Can we change the parameter?
For example:
<?php wp_tag_cloud('smallest=12&largest=12&unit=px&separator=|'); ?>
This code not work.
Codex says: The text/space between tags
This
<?php $tag_cloud=wp_tag_cloud('smallest=8&largest=18&format=array');
foreach($tag_cloud as $tags) :
echo $tags.' | ';
endforeach; ?>
Work fine. Thanks
The 2nd way to show the tags was was helpful. I was looking for a way to use ASCII code for my separator, like this:
<?php $tag_cloud=wp_tag_cloud('smallest=10&largest=20&format=array');
foreach($tag_cloud as $tags) :
echo $tags.' · ';
endforeach; ?>
EDIT: this line echo $tags.' · '; is this, without the spaces:
`echo $tags.' & # 1 8 3 ; ';
This topic has been closed to new replies.