Closed carolinan closed 3 years ago
I think we do actually need a separate template here — since Twenty Twenty-One hides the homepage title on the homepage automatically. It should probably have a query block, but with no page title.
If we did that, the list of blog posts would also not have titles.
We do not have traditional PHP conditionals, but we do have CSS. We can work around it, but a long term solution needs to be figured out for the editor.
.home:not(.blog) .wp-block-post-title, .home:not(.blog) .wp-block-post-comments, .home:not(.blog) .wp-block-post-comments-form { display: none; }
This would leave the .wp-block-separator above the content. Without a wrapper for the "post header" we can not just target the first separator of the page.
That the main
element is missing is also a big problem, I opened a new issue. #180.
Perhaps the solution is to allow themes to use .php files and unlimited PHP. That this decision has been left to Milestone:7 Gradual Adoption is problematic.
Or, we need to introduce another context for "home" and "blog".
Hmm. That's a good point. Perhaps for now we do remove the front-page.html
template, and discuss how to support the separate "single page w/no title" template in a separate issue. cc @scruffian for thoughts too.
Yeah we will definitely need to fix this in Gutenberg. I created an issue here: https://github.com/WordPress/gutenberg/issues/28564
Happy to remove the template for now, but I'd rather not fix it with CSS.
Agreed front-page doesn't make much sense. The relationship between front-page, home, page template, and the static homepage setting are all a bit confusing in WordPress. Would it make sense to have a page-home
template for the case of no title?
I think more generally we need make the "hide a title" something much more flexible across the board, for pages and posts alike — maybe a part of the post-title block setting a body-class or post-class.
That's what I did here: https://github.com/WordPress/theme-experiments/pull/184/files
Solves https://github.com/WordPress/theme-experiments/issues/167