WordPress.org

Ready to get started?Download WordPress

Forums

How do I change the font size in my tag cloud? (9 posts)

  1. marcia1723
    Member
    Posted 1 year ago #

    I saw in another post that I was supposed to edit: wp-includes/widgets.php and where it uses the Template Tag, wp_tag_cloud(), add the smallest, largest, and unit parameters to meet your needs.
    and in another
    To change the font sizes, edit wp-includes/widgets.php using information found at:
    wp_tag_cloud
    basically, you want this:
    wp_tag_cloud('smallest=8&largest=22');
    But I can't even find where I am supposed to do these things. I looked in my Theme as well, but didn't see it there (though I was able to change the font size for the text in my general blog posts

    [mod: moved to: 'How-To and Troubleshooting']

  2. luckdragon
    Member
    Posted 1 year ago #

    in your functions.php for your theme, you should be able to do something like:

    apply_filters('widget_tag_cloud_args', array('smallest' => 8,'largest' => 22))

  3. marcia1723
    Member
    Posted 1 year ago #

    @alchymyth said:
    if you are referring to the default 'tag-cloud' widget -
    use a filter function added to functions.php of your theme;
    example:

    add_filter('widget_tag_cloud_args','set_tag_cloud_sizes');
    function set_tag_cloud_sizes($args) {
    $args = array('smallest' => 8, 'largest' => 22);
    return $args;
    }

    Where do I put it? How do I put it?
    Do I just add that to the end of the php list?

  4. marcia1723
    Member
    Posted 1 year ago #

    LuckDragon, Where in the functions php would I put that?

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    Where in the functions php would I put that?

    anywhere, as long as it does not violate the php syntax and does not break any existing functions;

    for instance right at the end, before the last closing php tag ?> (if one exists)

  6. luckdragon
    Member
    Posted 1 year ago #

    yep, just what alchymyth said :)

  7. marcia1723
    Member
    Posted 1 year ago #

    Thanks :)
    I am NOT a programmer in any way shape or form. I have pasted the bottom of that php page, and I would REALLY appreciate it if you would tell me exactly where to put it:

    /**
    * Flush out the transients used in forever_featured_posts()
    */
    function forever_featured_post_checker_flusher() {
    // Vvwooshh!
    delete_transient( 'featured_posts_with_thumbnail' );
    }
    add_action( 'save_post', 'forever_featured_post_checker_flusher' );

    /**
    * This theme was built with PHP, Semantic HTML, CSS, and love.
    */

  8. luckdragon
    Member
    Posted 1 year ago #

    there is no "Exactly" as long as it is in that file, anywhere between a <? and a ?> tag, then it should work properly :)

    especially since every theme's functions.php file is different.

  9. marcia1723
    Member
    Posted 1 year ago #

    Thank you LuckDragon :)

Topic Closed

This topic has been closed to new replies.

About this Topic