Archive widget: limit the number of months to 12

If you want to limit the number of months to only 12 for your Archive widget in your theme sidebar, use the widget_archives_args filter to add the archives limit.

Insert the following code into the functions.php file of your theme.

function my_limit_archives( $args ) {
    $args['limit'] = 12;
    return $args;
add_filter( 'widget_archives_args', 'my_limit_archives' );

And to limit the number of months in Archives widget drop-down, use the following drop-down filter by replacing the last line of the above code.… Read the rest

Limit the number of tags in your WordPress tag cloud widget

If your WordPress-powered site has a lot of tags (and growing), you will probably be struggling with a messy-looking list inside the tag cloud widget. But you would rather show a decent number of tags instead of removing the widget altogether, right?

Place the following code in your theme’s functions.php file which should resolve this issue.

//Register tag cloud filter callback
add_filter('widget_tag_cloud_args', 'tag_widget_limit');

//Limit number of tags inside widget
function tag_widget_limit($args){

 //Check if taxonomy option inside widget is set to tags
 if(isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag'){
  $args['number'] = 10; //Limit number of tags

 return $args;

Let us know whether this works out for you just fine!… Read the rest

Page 1 of 16123456789101112...Last »