PHP API

By default the function tag_groups_cloud returns the html for a tabbed tag cloud. If you want to add the tag cloud directly into your theme, you could do it like this:

 if ( function_exists( 'tag_groups_cloud' ) ) echo tag_groups_cloud( array( 'amount' => 10 ) );

The array can, of course, contain also more parameters:

array( 'include' => '1,2,5,6', 'amount' => 10 )

If the optional second parameter is set to ‘true’, the function will return a multidimensional array containing tag groups and tags:

 if ( function_exists( 'tag_groups_cloud' ) ) print_r( tag_groups_cloud( array( 'orderby' => 'count', 'order' => 'DESC' ) , true ) );

Other Functions

post_in_tag_group( $post_id, $tag_group_id )

Checks whether the post with the given $post_id has at least one tag that is part of the tag group with the given $tag_group_id. Returns true or false.

Further Examples

You can find more examples of PHP code on this page.