I would like to create a page that will show all the posts from one particular category. I want to show the post title with the post thumbnail and content and nothing else ..no other meta ..no post date, no author, no excerpt , nothing I have tried to follow various answers/tutorials without success leading me to feel somewhat confused. Do I create a loop-category.php and add an if-category() statement for that category?? If so what statement please ?? please could someone explain clearly step by step Thank You

  • Your question is a little confusing, do you want this list of category posts on a special/specific page or are you just wanting to get control over the post listing on a native category archive, eg. example.com/category/some-category ?
    – t31os
    Mar 9, 2011 at 13:52

1 Answer 1


You don’t new »statements«. Take a look at the Template Hierarchy: WP does most of the work for you.

1. Find the name

Just create a new post list template, similar to your index.php and name it category-slug.php.

To get the slug part, go to wp-admin/edit-tags.php?taxonomy=category and look at the column named … slug.

See the full size image

In my example image the slug for the category Cat A is cata, so your template’s name has to be category-cata.php.

2. Write the template

That is even easier: Include your usual suspects (header, sidebar, footer) and put a very basic loop inside.

Sample code

<?php # -*- coding: utf-8 -*-
<h1><?php wp_title(); ?></h1>
<ul class="postlist">
while ( have_posts() )
    <li <?php post_class(); ?>><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    // If you need the full content, use
    // the_content();
    // wp_link_pages();
echo get_previous_posts_link(), get_next_posts_link();

WordPress will choose the template automagically, you have nothing more to do.

3. Style the template

In your theme’s header the element body or the element html (if you use HTML5 already) should have a call to body_class():

<body <?php body_class(); ?>>


<html lang="<?php bloginfo('language'); ?>" <?php body_class(); ?>>

Make sure your theme has it. On your new category archive the class attribute will look very similar to this:

class="archive category category-cata category-58 logged-in admin-bar"

Note the category-cata. You may now add special rules to your stylesheet (usually style.css) to change only this page.

Sample code

    background: #345;
    color:      #fff;
/* The thumbnails */
body.archive.category-cata .attachment-post-thumbnail
    float:      left;
    margin:     0 10px 10px 0;

And that’s all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.