X

Style the tag cloud

Adding this PHP code snippet to the functions.php of your wordpress theme will allow you to define style details like font-size small to large, and format of the tag cloud.



Code Snippet:


add_filter('widget_tag_cloud_args','style_tags');
function style_tags($args) {
$args = array(
'largest' => '10',
'smallest' => '10',
'format' => 'list',
);
return $args;
}

Comments  Leave a Reply

  1. Tagcloud Wordpress aanpassen | tekortschot.nl March 31, 2011 at 5:30 am

    […] WP-Snipp Twitter deze […]

  2. Paul te Kortschot March 29, 2011 at 7:35 am

    there anymore style possibilities within this snippet?

    1. Hi Paul,
      Yes you have a few more options, this is a list of them all.

      smallest – The smallest tag (lowest count) is shown at size 8
      largest – The largest tag (highest count) is shown at size 22
      unit – Describes ‘pt’ (point) as the font-size unit for the smallest and largest values
      number – Displays at most 45 tags
      format – Displays the tags in flat (separated by whitespace) style
      separator – Displays whitespace between tags
      orderby – Order the tags by name
      order – Sort the tags in ASCENDING fashion
      exclude – Exclude no tags
      include – Include all tags
      topic_count_text_callback – Uses function default_topic_count_text
      link – view
      taxonomy – Use post tags for basis of cloud
      echo – echo the results

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!