I'm pretty new to theme development, and trying to put together a new theme.

On my site, I'd like to set up some categories for the various blog posts. Easy enough. Then, I'd like to provide the user with a menu option that would take them to a page showing all posts that match only that specific category.

I have this working after making some tweaks to the index.php file, which is acting as my blog index - but I'd like to keep this as it is, and then have separate pages that filter the index of posts by category. So there might be a "Movies" index page, and a "Directors" index page.

I tried creating a new Page which had a template that would check the post categories .. but I think the bit I'm missing, is how to get a list of all actual blog posts from within a "Page".

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Dec 14, 2021 at 21:10

1 Answer 1


Ok, with a bit more digging, it seems there are two things I can do:

  1. Use the Categories menu option, which will then make use of the archive.php template - nice and easy.

  2. Use the WP_Query() function to make a direct DB query for a particular category .. I think this is exactly what I want to do.

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.