Skip to content

Instantly share code, notes, and snippets.

@2ndkauboy
Last active December 8, 2021 16:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2ndkauboy/36fdaa1107a8b31822c8 to your computer and use it in GitHub Desktop.
Save 2ndkauboy/36fdaa1107a8b31822c8 to your computer and use it in GitHub Desktop.
This plugin will limit the number of the shown tags to a custom number
<?php
/**
* Plugin Name: WP Tag Cloud Tag Number
* Description: This plugin will limit the number of the shown tags to a custom number
* Version: 1.0.0
* Author: Bernhard Kau
* Author URI: https://kau-boys.de
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0
*/
function widget_tag_cloud_tag_count( $args ) {
$args['number'] = 15; // change this to the number of tags you want to show
return $args;
}
add_filter( 'widget_tag_cloud_args', 'widget_tag_cloud_tag_count' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment