/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Show latest post for Tags * * @return * @param object $tag * @param object $show[optional] */ function show_title_tag( $tag, $show=5 ) { global $post; $posts = query_posts('tag=' . $tag . '&showposts=' . $show ); echo "<ul>"; foreach ($posts as $post ) : setup_postdata($post); ?> <li><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endforeach; echo "</ul>"; }
Comments
