Site logo

[Resolved] show tags

Home Forums Support [Resolved] show tags

Home Forums Support show tags

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2089345
    Den

    Hello Team,

    Hope you guys are doing well.

    I really wanna know how do I hide specific Tags using their id.

    HERE Tom gave a PHP code to limit the visibility of tags.

    Which works absolutely fine. But i’ll be very happy if you help me out with this “hide specific Tags using their id”

    Tom’s code:

    add_filter( 'widget_tag_cloud_args', 'generate_tag_cloud_limit' );
    function generate_tag_cloud_limit($args){ 
    	// Check if taxonomy option of the widget is set to tags
    	if ( isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag' ){
    		$args['number'] = 100; // Number of tags to show
     	}
    	return $args;
    }
    #2089561
    David
    Staff
    Customer Support

    Hi there,

    try this:

    add_filter( 'widget_tag_cloud_args', 'jmw_exclude_tag_from_tag_cloud');
    function jmw_exclude_tag_from_tag_cloud( $args ) {
      $args[ 'exclude' ] = '36'; // ID of the tag. If multiple tags use comma delimited sting '2,5,36'
      return $args;
    }

    For reference – this is the source of that code:

    https://www.calliaweb.co.uk/exclude-tag-cloud-widget/

    #2090278
    Den

    Amazing… Thanks

    #2090495
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.