Return to Snippet

Revision: 14467
at June 4, 2009 17:33 by gfazioli


Initial Code
/**
 * 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>";
}

Initial URL
http://www.undolog.com

Initial Description


Initial Title
Wordpress, show posts for category

Initial Tags
post, wordpress, category

Initial Language
PHP