• Skip to main content
  • Skip to primary sidebar

Victor Font Consulting Group, LLC

The DEX Intranet Specialists

  • Home
  • Care Plans
    • Care Articles
    • Optional Subscriptions
  • Consultations
  • Products
    • Code Snippets
    • Public GitHub Repositories
    • Gist Snippets
    • Pastebin Snippets (Free)
    • Free Plugins
  • FAQs
  • Support
    • Graphic Design
  • Contact
    • Speakers
    • Portfolio
  • Resources
    • Free WordPress Video Training
    • Tutorials
    • Articles
    • Cybersecurity
    • EU Referral Network

WordPress Tag Cloud Font Size

February 8, 2016 By Victor M. Font Jr.

Adjust WordPress Tag CLoud Font Size image

A poster recently asked, "How do I change the font size for the tag cloud widget? I can't find the CSS in my theme's style sheet."

The WordPress tag cloud plugin provides a visual representation of text data, used to depict post tags or categories on WordPress powered websites. This is an independent WordPress function. Themes designed for WordPress do not have CSS in their style sheets for formatting the WordPress tag cloud. The CSS for the tag cloud is built into the WordPress wp_tag_cloud() function, which is found in wp-includes/category-template.php. By design, the size of each tag is determined by how many times that particular tag has been assigned to posts. The font-size dimension is assigned to each tag at run time as inline CSS. There is no style sheet.

That being said, it is easy to change the sizes for tags using the widget_tag_cloud_args filter. There are two dimensions to change, smallest and largest. Add the following code to functions.php and set the size as you like it. The defaults are 8px for smallest and 22px for largest. In the example below, the smallest is set to 12px and the largest to 19px.

Parameters

Parameters that may be included in the above function are:

  • smallest—The smallest tag (lowest count) is shown at size 8
  • largest—The largest tag (highest count) is shown at size 22
  • unit—Describes 'pt' (point) as the font-size unit for the smallest and largest values
  • number—Displays at most 45 tags
  • format—Displays the tags in flat (separated by whitespace) style
  • separator—Displays whitespace between tags
  • orderby—Order the tags by name
  • order—Sort the tags in ASCENDING fashion
  • exclude—Exclude no tags
  • include—Include all tags
  • topic_count_text_callback—Uses function default_topic_count_text (deprecated)
  • link—view
  • taxonomy—Use post tags for basis of cloud
  • echo—echo the results

For further reerence, visit the wp_tag_cloud() page in the WordPress Codex: Here’s a link to the reference: http://codex.wordpress.org/Function_Reference/wp_tag_cloud

  • 9shares
  • Facebook0
  • Twitter0
  • Pinterest1
  • LinkedIn6
  • Print
  • SMS2

Filed Under: Code Snippet, WordPress Tagged With: Code Snippet, WordPress

About Victor M. Font Jr.

Victor M. Font Jr. is an award winning author, entrepreneur, and Senior IT Executive. A Founding Board Member of the North Carolina Executive Roundtable, he has served on the Board of Advisors, of the North Carolina Technology Association, the International Institute of Business Analysis, Association of Information Technology Professionals, Toastmasters International, and the North Carolina Commission for Mental Health, Developmental Disabilities, and Substance Abuse Services. He is author of several books including The Ultimate Guide to the SDLC and Winning With WordPress Basics, and Cybersecurity.

Primary Sidebar

Shopping Cart

Books

  • Ultimate Guide to the SDLC front cover The Ultimate Guide to the SDLC
    Rated 5.00 out of 5
    $74.95
  • Winning With WordPress Basics 2nd Edition Winning With WordPress Basics 2nd Edition $19.95

Recent Articles

  • Modern Scam Defense: How Consumers and Businesses Can Recognize and Stop Email, Phone, and Text Fraud
  • How to Write a PRD So Dense It’s Technically a Novel
  • Top 5 Plugin Names That Scare Our Legal Department
  • When Agile Meets Our 3-Year Waterfall Roadmap: A Love Story
  • Why Our Enterprise Needs 27 Stakeholders to Approve a Button Color Change

Top 10 Article Categories

Best Practice Code Snippet Computers and Internet Genesis How To Leadership Programming Servant Leadership Tutorial WordPress

 
We only use analytical cookies on our website that allow us to recognize and count the number of visitors, but they do not identify you individually. They help us to improve the way our website works. By clicking Accept you, agree to cookies being used in accordance with our Cookie Policy.