Skip to main content
Tweeted twitter.com/#!/StackWordPress/status/443669305134432256
deleted 6 characters in body
Source Link
Peter
  • 153
  • 1
  • 8

I am trying to create a tag cloud that combines different post types. When I do a generic wp_tag_cloud, it only pulls the tag from posts, but if I add the custom post type that I want to include in the args, then it displays tags from those posts. However, if I have the same tag cloud in a post and in a custom post type, it shows up twice, instead of being combined. For example, if I have a tag of "trampolines" in a post and the same tag in a custom post type of portfolio, then the tag cloud will display trampolines twice instead of weighting it as double. Any ideas how I can accomplish this?

<?php $args = array(
'smallest'                  => 8, 
'largest'                   => 18,
'unit'                      => 'pt', 
'number'                    => 450,  
'format'                    => 'flat',
'separator'                 => \\"\n\\  ",
'orderby'                   => 'name', 
'order'                     => 'ASC',
'exclude'                   => null, 
'include'                   => null, 
'topic_count_text_callback' => default_topic_count_text,
'link'                      => 'view', 
'taxonomy'                  => array('post_tag', 'portfolio_tag'), 
'echo'                      => true
    
); ?>

Tags: &nbsp;<?php wp_tag_cloud( $args ); ?> 

I am trying to create a tag cloud that combines different post types. When I do a generic wp_tag_cloud, it only pulls the tag from posts, but if I add the custom post type that I want to include in the args, then it displays tags from those posts. However, if I have the same tag cloud in a post and in a custom post type, it shows up twice, instead of being combined. For example, if I have a tag of "trampolines" in a post and the same tag in a custom post type of portfolio, then the tag cloud will display trampolines twice instead of weighting it as double. Any ideas how I can accomplish this?

<?php $args = array(
'smallest'                  => 8, 
'largest'                   => 18,
'unit'                      => 'pt', 
'number'                    => 450,  
'format'                    => 'flat',
'separator'                 => \\"\n\\  ",
'orderby'                   => 'name', 
'order'                     => 'ASC',
'exclude'                   => null, 
'include'                   => null, 
'topic_count_text_callback' => default_topic_count_text,
'link'                      => 'view', 
'taxonomy'                  => array('post_tag', 'portfolio_tag'), 
'echo'                      => true
    
); ?>

Tags: &nbsp;<?php wp_tag_cloud( $args ); ?> 

I am trying to create a tag cloud that combines different post types. When I do a generic wp_tag_cloud, it only pulls the tag from posts, but if I add the custom post type that I want to include in the args, then it displays tags from those posts. However, if I have the same tag in a post and in a custom post type, it shows up twice, instead of being combined. For example, if I have a tag of "trampolines" in a post and the same tag in a custom post type of portfolio, then the tag cloud will display trampolines twice instead of weighting it as double. Any ideas how I can accomplish this?

<?php $args = array(
'smallest'                  => 8, 
'largest'                   => 18,
'unit'                      => 'pt', 
'number'                    => 450,  
'format'                    => 'flat',
'separator'                 => \\"\n\\  ",
'orderby'                   => 'name', 
'order'                     => 'ASC',
'exclude'                   => null, 
'include'                   => null, 
'topic_count_text_callback' => default_topic_count_text,
'link'                      => 'view', 
'taxonomy'                  => array('post_tag', 'portfolio_tag'), 
'echo'                      => true
    
); ?>

Tags: &nbsp;<?php wp_tag_cloud( $args ); ?> 
Source Link
Peter
  • 153
  • 1
  • 8

Combining tags from post types

I am trying to create a tag cloud that combines different post types. When I do a generic wp_tag_cloud, it only pulls the tag from posts, but if I add the custom post type that I want to include in the args, then it displays tags from those posts. However, if I have the same tag cloud in a post and in a custom post type, it shows up twice, instead of being combined. For example, if I have a tag of "trampolines" in a post and the same tag in a custom post type of portfolio, then the tag cloud will display trampolines twice instead of weighting it as double. Any ideas how I can accomplish this?

<?php $args = array(
'smallest'                  => 8, 
'largest'                   => 18,
'unit'                      => 'pt', 
'number'                    => 450,  
'format'                    => 'flat',
'separator'                 => \\"\n\\  ",
'orderby'                   => 'name', 
'order'                     => 'ASC',
'exclude'                   => null, 
'include'                   => null, 
'topic_count_text_callback' => default_topic_count_text,
'link'                      => 'view', 
'taxonomy'                  => array('post_tag', 'portfolio_tag'), 
'echo'                      => true
    
); ?>

Tags: &nbsp;<?php wp_tag_cloud( $args ); ?>