[wp-trac] [WordPress Trac] #27425: Templates For Posts Formats
WordPress Trac
noreply at wordpress.org
Thu Jul 24 11:08:02 UTC 2025
#27425: Templates For Posts Formats
--------------------------------------------+-----------------------
Reporter: hardeepasrani | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Post Formats | Version:
Severity: normal | Resolution:
Keywords: dev-feedback needs-patch close | Focuses: template
--------------------------------------------+-----------------------
Changes (by callumbw95):
* keywords: dev-feedback needs-patch => dev-feedback needs-patch close
Comment:
Hey Everyone,
I have just taken a look at this, as it appears this ticket has been
sitting for the last decade without much movement. This ticket proposes a
significant change to the WordPress template hierarchy by introducing
dedicated template files for post formats (e.g., `single-quote.php`).
As mentioned by @SergeyBiryukov there is a filter you can add to your
theme to implement the file based method as initially suggested. Seeing as
you need to add support to your theme to include these in the first place,
it makes sense that if you wanted to add post formats to your theme, then
in the same place you could extend the templates if you wanted/needed too.
Secondary to this the recommended approach is to use `get_template_part()`
in conjunction with `get_post_format()`. For example, a theme can include
`get_template_part( 'content', get_post_format() )` within `single.php` or
`archive.php`, allowing it to load `content-quote.php`, `content-
gallery.php`, etc., based on the post's format.
Because both of these methods give ample customization for theme
developers without adding further complexity to the core template loading
process, implementing new template files for post formats in core feels
somewhat unnecessary as existing solutions suffice. As of such I am going
to mark this ticket with the `close` tag, but please feel free to continue
the conversation around this request further if you disagree with my
assessment. 😃
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27425#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list