Profile photo of Jessie WJessie W
asked 1 year ago

I want to change the height, I tried to do it in css:

“`
.widget_tag_cloud {max-height: 250px;}
“`

It does change the height but just the container, so all it’s doing is cutting it off. I’d basically just like to change the amount of tags that show but I’m not sure how to do that.

7 Answers
Dominic
answered 1 year ago

Please let me know detail about it, you can send me your site for further checking or a screenshot to clearly for your request.

Profile photo of Jessie WJessie W
answered 1 year ago

So the tag cloud widget currently displays 50-60 tags and is about 600 pixels. But I only want it to display ~30 tags. Can’t find a way to do that in settings so my question is, is there a way to do that in CSS? I changed the height of the widget, but that doesn’t work because it just gets cut off. What I want to do is change the amount of tags that display.

Profile photo of Jessie WJessie W
answered 1 year ago
Dominic
answered 1 year ago

To resolve this issue, you can add the following code to the style.css file:

.tagcloud {
 overflow-y: scroll;
 height: 220px;
}
Profile photo of Jessie WJessie W
answered 1 year ago

This does shrink the box, but I want to limit the amount of tags shown, not just make a smaller scroll box. Is there a way to cut down the number of tags that show?

Dominic
answered 1 year ago

You can add the following code to the functions.php file:

add_filter('widget_tag_cloud_args','set_tag_cloud_numbers');

function set_tag_cloud_numbers($args) {

$args = array_merge( $args, array('number' => 10) );

return $args; }
Profile photo of Jessie WJessie W
answered 1 year ago

Perfect, thank you!!

Powered by DW Question & Answer Pro

Access years of experience in WordPress; Collaborate with professionals trusted by tens of thousands of people across the world.

Sign Up Today