I'd like to make my tag pages like a little sitemap, pumping out a big list of links to all the posts in them. Is there a way to find out what tag is currently being shown and send it over to the get_posts command? Without a plugin preferably - I don't trust those things
This might work. I haven't tested it though. <?php $current_tag = single_tag_title(' ', false); $getposts = get_posts('tag='.$current_tag); foreach($getposts as $post) : ?> <a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a> <?php endforeach; ?> Code (markup):
there is a limit on the maximum number of tags that can be displayed in the tag cloud. http://codex.wordpress.org/Template_Tags/wp_tag_cloud#Examples what was posted above may work but by default wordpress will display no more than 45 tags
Check out this tutorial on making your search results unlimited: http://wphacks.com/how-to-make-wordpress-search-results-unlimited/ Yes, I know it's for search, although you can apply the same technique to tag pages as well. Instead of using search.php, put the code in tag.php. @just-4-teens: I think he's talking about tag archive pages, not tag clouds.
Got it working, thanks folks. Just a quick update for anyone else who might run into this: Get_posts doesn't seem to support tags at all (at least in the versions I tried). It'll give you every single blogpost, up to the max # if you try using it. Aka the codex help page is a bit wonky. However, you can fiddle with sticking tags into a WP_Query and then it works