Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to be able to display all the posts in a certain category on a page so that all posts are on that one page and there is no pagination.

If possible, I would also like to display a short preview of the posts - all posts will have a thumbnail and a short paragraph at the start.

I've tried various different plugins, but so far none of the one's that I have found do the job.

Does anybody know of a plugin or a way to do this? Alternatively, modifying the default category pages so there is no pagination is an option if all else fails...

share|improve this question

2 Answers 2

The way i'd do it:

First - create a page in the wp admin. Then create a file like mypage.php. Save it in your theme and a the top of it, add this to tell wordpress that this is a custom page template:

<?php /* Template Name: Custompage */ get_header(); ?>

Note: it'll also already call your header.

Then insert a custom loop using get_posts() like this:

<?php global $post; // required
$args = array('category' => 9); // include category 9
$custom_posts = get_posts($args);
foreach($custom_posts as $post) : setup_postdata($post);

// put here what you want to appear for each post like:
//the title:
the_title();

// an excerpt:
the_excerpt();

//and so on...    

endforeach;
?>

Then last, get back to the admin and in your page's options you should have a drop down menu in the "page attributes" box. Select the "Custompage" template or whatever name you gave it.

share|improve this answer
    
Sorry for the slow reply, and thanks for the code. However for some reason it didn't work for me first off and anyhow, it seemed a bit tedious having to create pages and select the template I have, so I have found a solution that works with the existing category pages (see my answer)... Thanks again though –  Andy Mar 17 '12 at 21:25
up vote 1 down vote accepted

I found a plugin-solution eventually to the my second option. I now use Posts per cat and set it to some silly number so that all of the posts in the category display on one page; it turns out that's all I needed!

Thanks and Regards

share|improve this answer

protected by Community Oct 23 '13 at 14:54

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.