WordPress.org

Ready to get started?Download WordPress

Forums

Adding a comma after each tag in a tag cloud? (3 posts)

  1. wynderlon
    Member
    Posted 4 years ago #

    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
  2. MichaelH
    Member
    Posted 4 years ago #

    Might look at Template Tag, wp_tag_cloud(), which has a format=array argument that you could use for that.

  3. blackmesa
    Member
    Posted 4 years ago #

    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');

Topic Closed

This topic has been closed to new replies.

About this Topic