Posted By

gfazioli on 06/04/09


Tagged

post wordpress tag querypost


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

maxvee8
joelhaus


Wordpress, show posts for Tags


 / Published in: PHP
 

URL: http://www.undolog.com

  1. /**
  2. * Show latest post for Tags
  3. *
  4. * @return
  5. * @param object $tag
  6. * @param object $show[optional]
  7. */
  8. function show_title_tag( $tag, $show=5 ) {
  9. global $post;
  10.  
  11. $posts = query_posts('tag=' . $tag . '&showposts=' . $show );
  12. echo "<ul>";
  13. foreach ($posts as $post ) : setup_postdata($post); ?>
  14. <li><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></li>
  15. <?php endforeach;
  16. echo "</ul>";
  17. }

Report this snippet  

You need to login to post a comment.