Adding post list to WordPress categories

Discussion in 'WordPress' started by jim, Jan 22, 2006.

  1. #1
    I found this on the web for adding a list of comments to a category. But no instructions - does anyone know how to have a list of posts displayed in a category?
            function bao_list_cat($cat) {
                    $query = "numberposts=20&order=DESC&orderby=post_date&category=$cat&offset=0";
                    if (is_array($posts=get_posts($query))) 
                            foreach ($posts as $post) {
                                    echo('<li><a href="'.
                                    get_permalink($post->ID).'">'.
                                    $post->post_title.'</a></li>');
                            }
            }
    Code (markup):
    I also found this plugin - http://blog.watershedstudio.com/2005/05/wordpress-category-posts-plugin-v10/ which might do waht I want. I'm not sure what I should use so if any other wordpress users ahve gotten the list of posts to display in a category, please let me know what worked for you.
     
    jim, Jan 22, 2006 IP