This topic has 3 replies, 2 voices, and was last updated 7 years, 8 months ago ago by Olga Barlow
Hi,
try to add code
//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;
}
but widget limit don’t working
Thanks
Best,
Paul
try to edit class-wp-widget-tag-cloud.php
$tag_cloud = wp_tag_cloud( apply_filters( 'widget_tag_cloud_args', array(
'taxonomy' => $current_taxonomy,
'echo' => false,
'number' => 10
) ) );
Now limit working, but it’s not very comfortably to edit this file after every wordpress update.
Hello,
Try this code
function filter_widget_tag_cloud_args( $array ) {
$array['number'] = 2;
return $array;
};
add_filter( 'widget_tag_cloud_args', 'filter_widget_tag_cloud_args', 10, 1 );
But keep in mind that this is default WP widget and our theme does not have any settings for this.
Our support does not include additional customization service. We provide support for XStore theme options and functions. Next time we won’t be able to provide support if your question is not related to theme functions.
Regards
Tagged: edit, functions.php, themes, woocommerce, wordpress
You must be logged in to reply to this topic.Log in/Sign up