Make tag cloud links consistent

I’m using this code:
<?php wp_tag_cloud( array( 'taxonomy' => 'channels') );?>

To display custom taxonomy as a cloud tag.
How can display with all links being the same size? I can’t seem to override the inline styles.

Related posts

Leave a Reply

2 comments

  1. How about passing the smallest and largest arguments to wp_tag_cloud() and making them both the same?

    <?php 
    wp_tag_cloud( 
        array( 
            'taxonomy' => 'channels',
            'smallest' => '1',
            'largest' => '1',
            'unit' => 'em',
        )
    );?>
    

    Update: use get_terms() to get multiple taxonomy terms:

    <?php $terms = get_terms(array('channels', 'stations'));
    if (is_array($terms)) : ?>
    <ol>
        <?php foreach ($terms as $term) : ?>
        <li><a href="<?php echo get_term_link($term) ?>"><?php echo $term->name ?></a></li>
        <?php endforeach; ?>
    </ol>
    <?php endif; ?>
    
  2. Strip the inline CSS with a filter on 'wp_tag_cloud':

    add_filter( 'wp_tag_cloud', 'wpse_56312_clean_tag_cloud' );
    function wpse_56312_clean_tag_cloud( $tags )
    {
        return preg_replace( "~ style='[^']*'~", '', $tags );
    }