Benjamin Lu

everyday is cool

The Pieces of a WordPress Theme

Once a site has more than a few entries, copying the same layout into every page stops being practical. A classic WordPress theme uses templates to place the content inside a common design. The idea is easiest to see by following one page through its templates.

On a local test site with a classic theme, inspect its files and find the header, footer, and stylesheet. Look for calls to get_header() and get_footer() in a template. Follow each call to the shared file it loads. Before editing, use a disposable copy of the theme so an update cannot overwrite your experiment.

Change a visible detail in the shared header and open a post and a page. Check whether both picked it up. If one didn’t, trace the template used by that page. Some themes use different header variants for different layouts.

WordPress classic theme documentation