1

the following filter worked fine:

function set_widget_tag_cloud_args($args) {
$my_args = array('smallest' => 16,
               'largest' => 24,
               'orderby'=>'name',
               'order'=>'RAND',
               'unit'=>'px',
               'separator' => '<span style="font-size:16px">&nbsp;|&nbsp;</span>',);
$args = wp_parse_args( $args, $my_args );
return $args;
}
add_filter('widget_tag_cloud_args','set_widget_tag_cloud_args');

With the new wp 4.9 however the 'smallest' and 'largest' arguments do not have any effect. It invariably shows 8pt for the 'smallest' and 22pt for the 'largest' font-size. The only argument that has an effect is 'order' => 'RAND'. The rest is ignored. I tried to alter the values in the source file (category-template.php). But also this test had no effect. Does anyone have an information about this behaviour? Thanks a lot for your interest. regards theo

2
  • Probably some plugins/theme interfering via filter, try another filter priority here, e.g. add_filter('widget_tag_cloud_args','set_widget_tag_cloud_args', 999 ); – birgire Nov 29 '17 at 16:44
  • @birgire – thanks for your answer, i already tried that one but sorry, priority has no effect – timholz Nov 29 '17 at 16:53
0

This solved the problem:

function my_custom_tag_cloud_widget( $args ) {
    $args['largest'] = 26;
    $args['smallest'] = 18;
    $args['format'] ='flat';
    $args['unit'] = 'px';
    $args['order'] = 'RAND';
    $args['separator'] = ' &bull; ';
    return $args;
}

add_filter( 'widget_tag_cloud_args', 'my_custom_tag_cloud_widget', 999 );

Thanks for your interest. theo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.