• Resolved screensnark

    (@screensnark)


    What template is used to display the page which returns category search results?

    I made a custom page that returns a page of posts which filters for a specific category, this allows me to put custom text at the top which explains what the category is, then lists the posts that fall under that category. However, I would like to tweak the layout a bit, so I want to take a look at the template that is used to display the standard category results, but I can’t figure out which template it is. Sorry if this is a silly question, I have 3 days under my belt messing with wp themes. (And I just redid everything as a child theme, as recommended). So what page is being displayed when you click on a catagory link and it displays a list of all the posts in that category. I believe it may be the same page which displays search results.

Viewing 5 replies - 1 through 5 (of 5 total)
  • If I understand correctly what you’re looking for, you’ll want to use category.php, which is in the top level of your parent theme. Out of the box, this template will have “Category Archive: …” at the top of the page. Sounds like you probably already know the following, but best practice is to then copy that file into your child theme directory.

    Good luck.

    Thread Starter screensnark

    (@screensnark)

    thanks, yeah, i am a little weird in that I have figured out how to do more advanced modifications quickly but still don’t have a full grasp on the basics.

    Thread Starter screensnark

    (@screensnark)

    hmm I dont see a category.php in the expound theme

    I didn’t realize you were using the Expound theme.

    Indeed, Expound does not have a category.php.

    When a theme doesn’t have a category.php file it looks for other templates to fall back on in a very specific order:
    archive.php, then index.php, which is the template Expound is falling back on.

    Here’s good source reading on the topic:
    http://codex.wordpress.org/Template_Hierarchy
    WP has provided a nice example that even uses the category.php issue.

    At this point, you could create your own category.php, or even a more granular approach, create a category-[##].php, where [##] is the number associated with the specific category. That would allow you to create various templates for different categories. You could start though by just creating category.php and base the code on WP’s out of the box twenty-thirteen.

    Take a look at this image for “fallback” templates:
    http://codex.wordpress.org/images/1/18/Template_Hierarchy.png

    Experiment and good luck.

    Theme Author Konstantin Kovshenin

    (@kovshenin)

    Please also make sure you’re using a child theme and not making changes directly in the original theme.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Categories display page’ is closed to new replies.