Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This is going to be tough to explain. I have created a custom theme and have a file called: categories.php, in this file i have:

        $args = array('hide_empty' => FALSE);

This displays all my categories as links, even the ones without a post associated with them.

My permalink structure is this /%category%/%postname%/ so when i click a category name i go to This is fine but what i'm struggling with is what file i have to create and what i have to put in said file so it displays all the posts from the clicked category?


share|improve this question

1 Answer 1

up vote 1 down vote accepted

if category.php does not exist, make a copy of archive.php or index.php and save it as category.php;

then, before the start of the loop, add:

<?php global $query_string; query_posts( $query_string . '&posts_per_page=-1'); ?>

share|improve this answer
Why the &posts_per_page=-1, what's the -1 about? – benhowdle89 May 14 '11 at 13:59
your question was for 'all posts' and -1 is the parameter to show all posts.… – Michael May 14 '11 at 14:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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