Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#10614 closed enhancement (fixed)

category-{slug}.php template

Reported by: scribu Owned by: scribu
Priority: normal Milestone: 2.9
Component: Template Version: 2.9
Severity: normal Keywords: has-patch needs-testing
Cc: Focuses:

Description

If a user needs to style a particular category differently, he can either use conditional code inside the category.php template, or make a category-{id}.php template.

The problem with the later is that when applying the theme to a different site, the category id will have likely changed.

That's why we need to use the category slug instead, so a theme can have something like this:

  • category.php
  • category-projects.php
  • category-announcements.php

etc.

Attachments (1)

get_category_template.patch (711 bytes ) - added by scribu 17 years ago.

Download all attachments as: .zip

Change History (4)

#1 @scribu
17 years ago

  • Keywords has-patch needs-testing added; needs-patch removed
  • Owner set to scribu
  • Status newaccepted

#2 @westi
17 years ago

Reviewing this now.

#3 @westi
17 years ago

  • Resolutionfixed
  • Status acceptedclosed

(In [11814]) Support location of category templates based on category slug as well as id. Fixes #10614 based on patch from scribu.

Note: See TracTickets for help on using tickets.