/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Show latest posts for category * * @return * @param object $cats * @param object $show[optional] */ function show_title_cat( $cats, $show=5 ) { global $post; $posts = query_posts('cat=' . $cats . '&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>"; }