How to Customize WordPress Tag Cloud Widget

Display All Tags

The number of Tag Cloud widget tags are limited to 45 by default. Default format of the cloud display is flat. To set number to unlimited and format to list:

function set_tag_cloud_args($args) {
	$args = array('number' => 0, 'format' => 'list');
	return $args;
}
add_filter('widget_tag_cloud_args','set_tag_cloud_args');

How to Display Text to Only Logged in WordPress Users

Create Shortcode for Logged in Users

function logged_in_only_shortcode($atts, $content = null) {
    if (is_user_logged_in() && !is_null($content) && !is_feed()) {
        return $content;
    }
}
add_shortcode('logged_in_only', 'logged_in_only_shortcode');

To use this shortcode in your post use the following code.

[logged_in_only]User is logged in.[/logged_in_only]

Create Shortcode for Logged Out Users

function logged_out_only_shortcode($atts, $content = null) {
    if (!is_user_logged_in() && !is_null($content) && !is_feed()) {
        return $content;
    }
}
add_shortcode('logged_out_only', 'logged_out_only_shortcode');

To use this shortcode in your post use the following code.

[logged_out_only]User is logged out.[/logged_out_only]

Resource: Display Text To Only Logged In WordPress Users

Scroll to Top