wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Style the tag cloud

wordpress snippet

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.

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

Did you like this post? If so please share it with your friends. Thanks!

  • http://twitter.com/Kortschot Paul te Kortschot

    there anymore style possibilities within this snippet?

    • http://wpsnipp.com Kevin Chard

      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

  • Pingback: Tagcloud Wordpress aanpassen | tekortschot.nl