page.html

Custom templates

Custom templates may be defined for single posts, pages or custom post types ( CPTs ).

They override the template hierarchy.

Custom templates may need to be defined in theme.json

Template name format Example & template name Usage
$custom featured-image-left Displays the featured image to the left of the post content. Used when the featured image is a narrow portrait image.
$custom output-input Debugging template parts or content
page-$slug page-template-hierarchy Template specifically for the template-hierarchy page
page-$id page-2 Template specifically for post ID 2 – initially the sample-page
page This page
singular Used if single / page is not found
index Default template

See Template hierarchy for the full hierarchy.

Navigation

Page List

Page Tree ( shortcode )

WordPress version: 5.7.2

Gutenberg version: 10.8.0

© Copyright Herb Miller, Bobbing Wide 2021