Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#18204 closed enhancement (wontfix)

Move theme def to index.php

Reported by: kingjeffrey Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:


I propose moving the comment defining the theme from style.css to index.php.

This would allow theme authors to:

  • name their stylesheets according to whatever convention they prefer (perhaps with a version number in the filename to avoid caching issues), or
  • to keep all css files in a dedicated directory (as I prefer).

It also simplifies the basic theme requirement to a single file.

The transition could be pretty simple:

  1. look first in the index.php file for the defining comments,
  2. if not present, look in style.css to maintain backwards compatibility.

Change History (2)

#1 @nacin
10 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

This would be a pretty big change.

It also doesn't come without backwards compatibility concerns: while a theme typically needs index.php, a child theme only requires style.css.

There's no requirement for you to use style.css as your stylesheet, technically. You can use it for the headers only, then enqueue your own script out of your theme's css/ directory.

Finally, if you do enqueue styles via wp_enqueue_style, you can bake in your own version numbering for cache-busting. Core supports using query strings for this -- actually renaming files is never really necessary.

I think therefore it is safe to close this as wontfix.

#2 @dd32
10 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.