Support » Fixing WordPress » Adding a comma after each tag in a tag cloud?

  • Is there a way to add a comma after each tag in a tag cloud? For example, instead of this:

      tag 1 tag 2 tag 3 tag 4 tag 5 tag 6

    It would look like this:

      tag 1, tag 2, tag 3, tag 4, tag 5, tag 6
Viewing 2 replies - 1 through 2 (of 2 total)
  • Might look at Template Tag, wp_tag_cloud(), which has a format=array argument that you could use for that.

    Filter the seperator arg for the tag cloud function. Put the following in your functions.php

    /**
     * Filter arguments of tag cloud widget to enlarge our text and
     * add commas
     */
    function myfunc_filter_tag_cloud($args) {
    	$args['smallest'] = 18;
    	$args['largest'] = 32;
    	$args['unit'] = 'px';
    	$args['separator']= ', ';
    	return $args;
    }
    add_filter ( 'widget_tag_cloud_args', 'myfunc_filter_tag_cloud');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding a comma after each tag in a tag cloud?’ is closed to new replies.