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 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 ); ?> 

Related posts

1 comment

  1. As John said in his comment, you have two taxonomies with separate terms. If both posts and portfolios are to share tags, instead of using a new taxonomy just extend post_tags to portfolio custom post type :

    register_taxonomy_for_object_type( 'post_tag', 'portfolio' );
    

Comments are closed.