WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] page template to archive (5 posts)

  1. wrimomatt
    Member
    Posted 1 year ago #

    I have a custom page template built that works for a specific category, but I want to build a custom archive to do the same thing. I essentially want to be able to display all of the posts in a particular category in a particular way. I can accomplish the same thing by making the page display unlimited posts, but an archive would be more direct.

    I've built a few archives, but no matter what I do everything just uses the default arhive.php file.

    Ideas?

  2. Try using category-id.php

    So if your category is id = 3, just make a category-3.php

    I find category.php templates easier to work with.

  3. wrimomatt
    Member
    Posted 1 year ago #

    I love me some IDs, but trying to ween myself off them because they change from development to deployment. would category-slug.php work the same way?

  4. wrimomatt
    Member
    Posted 1 year ago #

    thanks. problem solved!

    I was staring at the hierarchy earlier and couldn't for the life of me figure out why it wasn't working. I had no generic category.php file, just an archive.php. So I copied my archive to create a generic category.php (thinking how could I have a custom version of something that didn't exist) and presto! the other custom templates started working!

Topic Closed

This topic has been closed to new replies.

About this Topic