Use it on your archives.php template. This function grabs the categories and lists all according posts below that category.

/**
* Snippet Name: List all categories and their matching posts
* Snippet URL: http://www.wpcustoms.net/snippets/list-all-categories-and-their-matching-posts/
*/
// Make a header for the cateogry
echo ”

“.$cat->name.”

“;
// create a custom wordpress query
query_posts(“cat=$cat_id&posts_per_page=100”);
// start the wordpress loop!
if (have_posts()) : while (have_posts()) : the_post(); ?>



‘; ?>


0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x