How to use WP-Cumulus shortcodes

Contrary to what I originally thought when I released WP-Cumulus, it seems most people prefer to use it on their blog’s sidebar. I estimate that at least 80% of users use the widget. But the plugin still has two other ways to embed the movie into your blog, and version 1.20 greatly improves the most important of those. Shortcodes can be incredibly useful, and version 1.20 of my plugin now properly supports them.

Shortcodes

WordPress 2.5 introduced an API that allows us plugin creators to easily create square bracket ‘tags’ that users can type into blog posts and pages to trigger plugin output. WP-Cumulus has used something similar since day one, but the official shortcodes API allows for a lot more flexibility.

The most important change is that you can pass parameters. For Cumulus, this means you can override your default settings each time you embed a tag cloud into a post. Lets assume you’ve set up the non-widget version of the tag cloud to be 500 pixels wide. You can now use the following shortcode to display it at 300 pixels.

[wp-cumulus width="300"]

If you’d instead like a cloud with red tags and a transparent background, here’s the code for that:

[wp-cumulus tcolor="ff0000" tcolor2="ff0000" trans="true"]

Supported attributes

Here is a complete list of the attributes WP-Cumulus currently supports:

AttributeUsed forPossible valuesExample
widthWidth of the tag cloudNumber of pixels (positive integer)width=”300″
heightHeight of the tag cloudNumber of pixels (positive integer)height=”240″
tcolorTag colorHEX color value without the ‘#’ prefixtcolor=”ffcc00″
tcolor2Tag color for less important tagsHEX color value without the ‘#’ prefixtcolor2=”cc9900″
hicolorTag highlight colorHEX color value without the ‘#’ prefixhicolor=”ffffff”
bgcolorTag cloud background colorHEX color value without the ‘#’ prefixbgcolor=”333333″
speedRotation speedPrecentage, higher means fasterspeed=”150″
transBackground transparency“true” or “false”trans=”true”
distrEven tag distributions along sphere“true” or “false”distr=”true”
argsArgments to be passed to the ‘wp_tag_cloud’ function (experimental, use at own risk)URL encoded stringargs=”smallest=10″
modeTag/Category mode“tags”, “cats” or “both”mode=”tags”

Default values

By using any of these attributes, you override the values entered under ‘Settings->WP Cumulus”. These serve as the defaults used when using the shortcode, so simply entering [wp-cumulus] into a post will result in a tag cloud with those settings. If you have only one cloud inside a post or page it’s probably best to change the main settings. The attributes listed above will allow you to have multiple clouds inside posts, all with different settings.

WordPress 2.5 and up

Please note that since the shortcodes API was introduced in WordPress 2.5, none of this will work on older versions. The new lowercase shortcodes replace the old [WP-CUMULUS] one. That still works for now, but is ‘deprecated’ for blogs running WP 2.5 or newer.

144 Comments

  1. thank’s..for tutorials..

    Comment by Hakim — January 6, 2010 @ 4:48 am

  2. Can I use this tag cloud in tumblr?

    Comment by tek penny — January 14, 2010 @ 12:03 pm

    • Tek penny, I’m not sure. I have tutorials available for anyone willing to attempt this, but I haven’t looked at it myself.

      Comment by Roy — January 21, 2010 @ 9:47 am

  3. Hi Roy,

    I would like to try myself, where can I find the tutorials?

    thanks a lot

    Comment by tek penny — January 21, 2010 @ 10:32 am

  4. tek penny: here. Please keep me posted!

    Comment by Roy — January 21, 2010 @ 10:37 am

  5. Link: welcome « open design network
  6. Link: Fazenda Nova Gokula - Hare Krishna!
  7. Link: WP-Cumulus Review
  8. Link: WP-Cumulus Review | Abhishek.biz
  9. Link: Display your tags in 3D — XtazePress
  10. Link: Cara Memasang Tag Cumulus Di Wordpress « prandah.co.cc
  11. Link: Tag clouds. Good practices | My Life
  12. Link: WP-Cumulus » 云帆
  13. Link: wp-cumulus.1.23
  14. Link: Online Area Belajar Gratis | ZA-EdotCOM » Blog Archive » Belajar Membuat Tags/Category Bentuk Bola Di WordPress Dengan Pulgin WP-Culumus
  15. Link: Tag Cumulus | prandah.com
  16. Link: How to use WordPress plugin: WP-Cumulus Flash based tag cloud - Helen Lee: Fashion, Life, and Learning