WordPress / twentytwentyfive

100 stars 70 forks source link

Post format archive templates #17

Open carolinan opened 2 months ago

carolinan commented 2 months ago

It has probably not gone unnoticed that there is a request to add support for post formats to block themes in general and Twenty Twenty-Five.

Currently, there are only two things that the theme can do to support post formats:

From the theme developer handbook:

In the case of post formats, the taxonomy is ‘post_format’ and the terms are ‘post-format-{format}. i.e. taxonomy-post_format-post-format-link.php for the link post format.

https://developer.wordpress.org/themes/basics/template-hierarchy/#custom-taxonomies

justintadlock commented 2 months ago

I did quite a bit of exploration for post formats here: https://github.com/x3p0-dev/x3p0-ideas/issues/17

It's probably a bit more involved than we'd want to include a default theme, but just sharing in case any of it's useful.

beafialho commented 3 weeks ago

What else is needed from design here? There are "post format" templates mocked up here.

carolinan commented 3 weeks ago

Then I will remove the needs design label.

carolinan commented 3 weeks ago

@beafialho The theme can include archive templates for post formats. But not templates for single post formats. It is not part of the template hierarchy.

carolinan commented 3 weeks ago

Hm, actually that does not work either. When the query loop is set to inherit the query from the template, the editor shows all posts, but the front shows the correct post with the expected format.

Branch for testing: https://github.com/WordPress/twentytwentyfive/tree/add/post-formats Create a new post and assign it the link format. Save. Go to the front of the site and add type/link : yoursite.domain/type/link. Confirm that the archive shows the post you created. In the admin toolbar, select "Edit site" to open the template for the link format. The query block, which is supposed to inherit the parameters from the template, shows all posts.