Retrieves path of single template in current or parent template. Applies to single Posts, single Attachments, and single custom post types.
Description
The hierarchy for this template looks like: <ol> <li>{Post Type Template}.php</li> <li>single-{post_type}-{post_name}.php</li> <li>single-{post_type}.php</li> <li>single.php</li> </ol> An example of this is: <ol> <li>templates/full-width.php</li> <li>single-post-hello-world.php</li> <li>single-post.php</li> <li>single.php</li> </ol> The template hierarchy and template path are filterable via the '$type_template_hierarchy' and '$type_template' dynamic hooks, where $type is 'single'.
Signature, return type and hooks compared across 5 parsed releases.
4.7.0
{Post Type Template}.php was added to the top of the template hierarchy.from the docblock
4.7.0
The decoded form of single-{post_type}-{post_name}.php was added to the top of the template hierarchy when the post name contains multibyte characters.from the docblock
4.4.0
single-{post_type}-{post_name}.php was added to the top of the template hierarchy.from the docblock
1.5.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.