WordPress.org

Support

Support » Themes and Templates » What's the file to edit the category template?

What's the file to edit the category template?

  • hildergarn
    Member

    @hildergarn

    Hi. I want to know what’s the file template I need to open to edit the category template? Maybe it’s a silly question, but I tried to find the answer with no success.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • technodude95
    Member

    @technodude95

    It’s the ‘archive.php’ template.

    I would be wary of the below method because it requires you to not only assign individual php pages to categories (which in itself requires a set of requirements for making sure the new template is formatted correctly), but also actually create a new template versus just editing one.

    ANSWER:
    The way that wordpress generates category pages is using the ‘archive.php’ template. Edit that and it will edit the layout of the page when anyone clicks on any category.

    Tarsem Singh
    Member

    @tarsemsingh

    Hi hildergarn,
    it’s Not a silly question 🙂 .
    You can Create a page with name category.php.. for more information please visit . Category Templates

    Michael
    Forum Moderator

    @alchymyth

    working with this codex chapter, you shold be able to find which template is doing what:
    http://codex.wordpress.org/Template_Hierarchy

    what’s the file template I need to open to edit the category template?

    starting at the top of the list – if the template does not exist in your theme, look for the one further down:

    category.php
    archive.php
    index.php

    example:
    assuming that your theme does not have a category.php, but you wat to style category archives different from normal (date) archives, make a copy of archive.php and save it as category.php (you need to use ftp or the file management of your hoster for this) then edit it to your needs.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘What's the file to edit the category template?’ is closed to new replies.