Display one category in one page

From what I understand, the question is, how can you show only one category on a WordPress Page?

What Scuba Kay is suggesting is the default category archive, if you want to go that route, WordPress already has archive pages with your posts for each category without you having to create your own Page. If you want to make changes to this archive page, you can read up on Category Templates. This will enable you to create your own template for a specific category.

If you literally want to create a WordPress Page and just call posts from a category, you can create a Page Template and use a Query similar to what you’re already doing and create your own Loop. There’s another good question on this site that explains how to pull posts using the Codex as reference.

So for example, if you’re using get_posts to call a reviews category on a Page Template, it might look something like this:

<?php 
        $reviewArgs = array( 
            'category' => '3', 
            'posts_per_page' => 5
        );
        $reviews = get_posts( $reviewArgs );
        foreach ($reviews as $post) :  setup_postdata($post); 
            the_post_thumbnail();
            the_title();
            the_content();
        endforeach; 
?>

Hope that helps!

Leave a Comment