• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Tag Cloud Issue

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Tag Cloud Issue

This topic is: resolved

Tagged: tag cloud

  • This topic has 6 replies, 3 voices, and was last updated 9 years, 11 months ago by eventspanda.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • January 28, 2016 at 7:31 am #177723
    Mark-C
    Member

    Hi All,

    On my previous installation of WordPress 4.3.2 / Genesis 2.2.3, i setup a tag cloud in the sidebar. Only those tags associated to the post were displayed (using code below)
    I was able to style the heading etc.

    add_filter('widget_tag_cloud_args','single_post_tag_cloud_tags');
    function single_post_tag_cloud_tags($args) {
    
    	if ( is_single() ) {
    		global $post;
    		$post_tag_ids = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) );
    		$args = array('include' => implode(',',$post_tag_ids));
    		$args['largest'] = 12; //largest tag
    		$args['smallest'] = 12; //smallest tag
    		$args['format'] = 'list'; //ul with a class of wp-tag-cloud
    	}
    	return $args; 
    }

    Issue
    Having updated to WordPress 4.4.1, all i see is the tags. Title and styling is lost.

    February 5, 2016 at 5:36 am #178368
    Mark-C
    Member

    Hi All,

    I wonder if anyone has experienced Tag Cloud issues following on from Worpdress 4.3.2.
    As previously mentioned along with the code, I was able to display all tags associated to a single post in a list form along with styling elements. Now all styling elements are lost. If on the other hand I remove the above code then I get the traditional tag cloud appearing with style elements.

    Does anyone know how to display only the tags associated to a single post, whilst having the freedom to style the tag cloud widget?

    Thanks
    Mark C

    February 6, 2016 at 12:31 pm #178472
    Christoph
    Member

    Hi,

    a link to the website would be helpful.

    I guess the title is still set in the tag widget?


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    February 7, 2016 at 3:28 am #178502
    Mark-C
    Member

    Hi Christoph,

    My site is on a localhost.

    Feel free to give this a test run to see my point.

    Install WP4.41 or higher, Genesis Framework, Genesis Sample Theme.
    On the Hello World Post create a couple of tags and update.
    Drill to Appearance | Widget | Primary Sidebar and add a Tag Cloud Widget. Give the Tag Cloud a title 'Blah Blah Blah'

    Display page in Firefox or Chrome and inspect element for the tag cloud ... all good!

    Now,
    add the below code into functions.php.

    add_filter('widget_tag_cloud_args','single_post_tag_cloud_tags');
    function single_post_tag_cloud_tags($args) {
    
    		global $post;
    		$post_tag_ids = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) );
    		$args = array('include' => implode(',',$post_tag_ids));
    		$args['largest'] = 12; //largest tag
    		$args['smallest'] = 12; //smallest tag
    		$args['format'] = 'list'; //ul with a class of wp-tag-cloud
    	return $args; 
    }

    Whilst the tag cloud is in a list format, all ability to format has been lost ... inspect tag cloud using inspect element.

    Thank You

    Mark

    February 12, 2016 at 11:59 am #178907
    Christoph
    Member

    Hi Mark,

    sorry I either missed the notification that you responded to the topic or I didn't get one...
    Use this code instead.

    add_filter('widget_tag_cloud_args','single_post_tag_cloud_tags');
    function single_post_tag_cloud_tags($args) {
    
    		global $post;
    		$post_tag_ids = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) );
    
    		$my_args = array(
    		'include' => implode(',',$post_tag_ids),
    		'largest' => 12, //largest tag
    		'smallest' => 12, //smallest tag
    		'format' => 'list', //ul with a class of wp-tag-cloud
    		);
    		$args = wp_parse_args( $args, $my_args );
    
    		return $args;
    }

    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    February 13, 2016 at 6:21 am #178957
    eventspanda
    Member

    Thanks for the code dear! I have the same problem after wordpress theme updation.


    http://www.eventspanda.com

    February 14, 2016 at 4:00 am #179005
    Mark-C
    Member

    Hi Christoph,

    Your script works a treat.
    Thank you so much for help and support.

    One happy bunny,

    Mark C

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Tag Cloud Issue’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble