I needed to get the number of post per type per term so i created this small function:
function get_term_post_count_by_type($term,$taxonomy,$type){
$args = array(
'fields' =>'ids', //we don't really need all post data so just id wil do fine.
'posts_per_page' => -1, //-1 to get all post
'post_type' => $type,
'tax_query' => array(
array(
'taxonomy' => $taxonomy,
'field' => 'slug',
'terms' => $term
)
)
);
$ps = get_posts( $args );
if (count($ps) > 0){return count($ps);}else{return 0;}
}
and once you have this function you can change your code a bit to this:
<?php
$ptypes = array('post','blog','pic'); //array with all of your post types
$tags = get_tags( array('name__like' => "a", 'order' => 'ASC') );
foreach ( (array) $tags as $tag ) { ?>
<li>
<a href="https://wordpress.stackexchange.com/questions/33455/<?php echo get_tag_link( $tag->term_id ) ?>">
<span class="name"><?php echo $tag->name ?></span>
<span class="number">
<?php
$count = 1;
foreach($ptypes as $t){
echo get_term_post_count_by_type($tag,'post_tag',$t) . " " . $t;
if (count($ptypes) != $count){
echo " | ";
$count = $count + 1;
}
}
?>
</span>
</a>
</li>
<?php } ?>