Function: wp_tag_cloud

wp_tag_cloud( array | string $args )

Displays a tag cloud.

Shortcut: wtc

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.

Parameters

Name Type(s) Default Value Description
$args array | string ''

{ Optional. Array or string of arguments for displaying a tag cloud. See wp_generate_tag_cloud() and get_terms() for the full lists of arguments that can be passed in $args.

@type int    $number    The number of tags to display. Accepts any positive integer
                        or zero to return all. Default 0 (all tags).
@type string $link      Whether to display term editing links or term permalinks.
                        Accepts 'edit' and 'view'. Default 'view'.
@type string $post_type The post type. Used to highlight the proper post type menu
                        on the linked edit page. Defaults to the first post type
                        associated with the taxonomy.
@type bool   $echo      Whether or not to echo the return value. Default true.

}

Returns

void | array

Generated tag cloud, only if no failures and 'array' is set for the 'format' argument. Otherwise, this function outputs the tag cloud.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.