Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Move $content_width declaration inside _s_setup() #100

@michiecat

Description

@michiecat

On one of the articles in theThemeShaper WordPress Theme Tutorial: 2nd Edition Series, which uses code based on _s, it's been suggested in the comments that $content_width should be moved inside _s_setup().

Here is the reason given in the comments (by Justin Tadlock):

"This makes sure that it’s easy for child themes to know exactly what point to overwrite it. It also allows you to get rid of the isset() check."

(I'm aware that _s is not intended to be a parent theme, though.)

Chip Bennett commented:

"We (the Theme Review Team) have been trying to move developers more toward putting everything in functions.php inside callbacks. Is there any advantage/disadvantage in doing so with $content_width?"

Opinions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions