0

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:

    <?php
        $args = array('hide_empty' => FALSE);
        wp_list_categories($args);
    ?>

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 http://example.com/category/action/. 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?

Thanks

1 Answer 1

1

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'); ?>

2

Your Answer

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

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