• Resolved pigdog234

    (@pigdog234)


    I’ve used the tag cloud widget for, well, forever. I am specifically used to, and enjoy the sizing of the tags according to how often they are used. Unfortunately with 2016, that is gone. In addition, each tag is now boxed. This just doesn’t look quite right. Is that intended or is this widget simply incompatible with 2016?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Is there any update on the tag cloud? It currently appears as a simple list of the tags rather than weighting them by their popularity. Is this part of the design or will it be amended? Thanks

    Thread Starter pigdog234

    (@pigdog234)

    So I did a bit of looking. The theme is adding a callout:
    twentysixteen_widget_tag_cloud_args in functions.php, which is causing part of the problem. There’s also a CSS problem, but I haven’t isolated it.

    That’s great thank you – i’ve commented it out for the moment and will work on putting the change into my child theme.

    I just switched to the twentysixteen theme and noticed the behavior pigdog234 mentioned above [tag cloud widget display is broken]. Commented out the add_filter call in functions.php per previous post and sizes are now nonuniform again [yay], although the spacing is loose and the tags are all boxed… I’m interested in any further discoveries on using this widget with this theme.

    This is a deliberate design decision, and such, probably isn’t going to be changed. You could change it in a child theme, though, with this function in your child theme’s functions.php:

    function twentysixteen_child_init() {
      remove_filter( 'widget_tag_cloud_args', 'twentysixteen_widget_tag_cloud_args' );
    }
    add_action( 'init', 'twentysixteen_child_init', 20 );

    and then using this CSS in your child theme’s stylesheet:

    .tagcloud a {
      border: none;
      margin: 0;
      padding: 0;
    }
    
    .tagcloud a:hover,
    .tagcloud a:focus {
      border: none;
    }
    Thread Starter pigdog234

    (@pigdog234)

    Thanks for tracking down the CSS, stephencottontail. It’d be good if the developers could explain their reasoning. I guess at this point because the theme is out there it will not be changed in any significant way.

    Thread Starter pigdog234

    (@pigdog234)

    Following up on this, I did exactly as stephencottontail suggested by creating a child theme.

    There was exactly one more gotcha. If like me you are an old fogie and like to use bookmarkify, you will have to make a change to bookmarkify itself because twentysixteen’s CSS prefers “display: block” and bookmarkify relies on “display: inline”. Otherwise you get a vertical listing of the images.

    Unfortunately bookmarkify hasn’t been touched in a long time, but I’ll post a quick diff here and see if I can goad the author into accepting it.

    diff -c bookmarkify.php~ bookmarkify.php
    *** bookmarkify.php~	Sun Sep  5 13:43:33 2010
    --- bookmarkify.php	Fri Feb  5 11:22:38 2016
    ***************
    *** 602,608 ****
      				else
      				{
      					$d.= "<a href='".$link[2]."' title='".$link[1]."' onclick='target=\"".$bookmarkifyLinkTarget."\";' rel='nofollow'>"
    ! 							. "<img src='".$iconFolder."/".$link[3]."' style='width:16px; height:16px;' alt='[".$link[0]."] ' $endTag>"
      							. "</a> ";
      				}
      			}
    --- 602,608 ----
      				else
      				{
      					$d.= "<a href='".$link[2]."' title='".$link[1]."' onclick='target=\"".$bookmarkifyLinkTarget."\";' rel='nofollow'>"
    ! 							. "<img src='".$iconFolder."/".$link[3]."' style='width:16px; height:16px; display: inline' alt='[".$link[0]."] ' $endTag>"
      							. "</a> ";
      				}
      			}

    Hi I’m trying to add a tag cloud for the first time. I tried @stephencottontail script in function.php in my child theme, all tags still come out same size.

    Is it always twentysixteen_child_theme. On filezilla I load the style.css and function.php into twentysixteen-child directory. Where you have twentysixteen_child_init I changed to twentysixteen-child_init but with that the homepage refuses to load (!).

    I also tried https://www.ads-software.com/plugins/categorized-tag-cloud/ and again tags come out same size.

    My site https://www.theideastring.com
    Any other ideas?

    PHP will choke if you change my code to twentysixteen-child_init, as you’ve just found out. If you have FTP/cPanel/etc. access to your site, you should change it back to twentysixteen_child_init and then clear your cache and access your site again. If you still have a problem after you’ve done that, then post again and we’ll try to figure it out.

    Hi,

    From googling it looks like there is no default cache in WP, unless you install a plugin? (Might be a good idea, pages are a bit slow to load sometimes).

    I fixed the code back to twentysixteen_child_init two days ago before I posted and got the site back up again. But the font size of the tag cloud is still uniform. ??

    Sorry for the late reply. On line 75 of your child theme’s stylesheet, you’ve got this code:

    .widget li a, .widget a{
          font-family: Montserrat, "Helvetica Neue", sans-serif;!important;
          font-size: 14px !important;
    }

    which is setting all <a> tags within a widget to 14px, and the !important is overriding the inline styles set in the tag cloud widget. Removing the !important would keep the other links in the sidebar the right size and let the links in the tag cloud grow and shrink as needed.

    Thanks Stephen, that’s fixed it.

    In case it’s useful to anyone I’ve added this to set min and max font sizes in the tagcloud.

    /* define max and min sizes for tags in cloud */
    add_filter('widget_tag_cloud_args','set_tag_cloud_font_size');
    function set_tag_cloud_font_size($args) {
        $args['smallest'] = 10; /* Set the smallest size to px */
        $args['largest'] = 18;  /* set the largest size to px */
        return $args;
    }

    The site looks fine taking out the !important, but there may have been a reason I added it. If I put it back can I define a style for the tag cloud that ignores that? Possibly not as I read tag clouds are a function rather than a css thing?

    • This reply was modified 8 years, 2 months ago by mattnotfat.
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Tag Cloud Broken in 2016’ is closed to new replies.