• Hello, do you know the php command for displaying Tags as a list, not as a cloud.

    Thanks a lot

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is what I’ve used. It still comes with the tag cloud baggage, but each tag is the same size (set to 1em so it responds well to CSS styles) and is wrapped in a list.

    <?php
    	$tag_list = wp_tag_cloud('format=array&orderby=name&order=ASC&smallest=1&largest=1&unit=em&number=0');
    	if (!empty($tag_list)) {
    		echo "<p>Tags:</p><ul>";
    		foreach ($tag_list as $key => $tag) {
    			echo "<li>$tag</li>";
    		}
    		echo "</ul></div><!-- end tags -->";
    	}
    
    ?>

    Correction: If the smallest and largest are set to the same size, WP will still make the tags different sizes. I think this is a bug. Work-around is to make the two sizes just a little different, but not enough to be noticeable.

    <?php
    	$tag_list = wp_tag_cloud('format=array&orderby=name&order=ASC&smallest=1&largest=1.001&unit=em&number=0');
    	if (!empty($tag_list)) {
    		echo "<p>Tags:</p><ul>";
    		foreach ($tag_list as $key => $tag) {
    			echo "<li>$tag</li>";
    		}
    		echo "</ul></div><!-- end tags -->";
    	}
    
    ?>

    There should be a WP function to provide a simple non-cloud-style list.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Tag list’ is closed to new replies.