-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use core/post-template
to have each post render within <article>
tags
#37659
Comments
Hi, Paul I think adding an HTML element selector to the Advanced settings makes sense. /cc @ntsekouras What do you think? |
Hey @paulgibbs, thanks for the issue!
Actually it was something like this (with
The |
I was just about to create the same feature request. A tag selector is definitely needed, just like what Group has. I think everything should still be in a list (the lets screen readers know how many links/cards there are), but the next child/wrapper tag should be a |
What about something like this? Query Block Wrap posts in (Select Option):
Post Template Block HTML-element (Select Option):
This way we can make:
and:
|
Yes, please have a tag selector or use something else as the default. I often have list levels styled differently, and in certain situations am including the full content of a post in an aggregate page, so this is forcing me to add a fair bit of extra css to reset the default list styles. I would argue article is semantically appropriate at least as often as ul/li, and is less likely to cause style issues. |
I think the best way to solve this is for the theme developer / advanced user to place a group inside the post template and change the default div to an article. |
I don’t think it is essential that we need to be able to change the Since WordPress 6.1 it has been possible create query block variations , which truly is a phenomenal way to create simplified presets of the query block. To be able to register variations of the post template block it in the same spirit and in a similar (relatively) simple manner that would an equally great to substitute the built-in tags with the tags appropriate to a specific query block variation. Eg. If a developer could register a article-template variation, which uses
|
I just came here to suggest the exact same thing. I think this is the best solution and also serves other purposes beyond customising the root element (i.e. from For example, I have a slider block. I've created a variation of the Query Loop block called Slide Query Loop. I can use Post Template, but I wanted to create a Slide Template variation of the Post Template block so that I can add settings to the slides. Being able to create variations of the Query Loop block is powerful but given that the Post Template block is exclusive to the Query Loop, I feel as though that should also be extensible. |
What problem does this address?
How should I use the
core/post-template
block to have each post render within<article>
tags?With WP 5.9 beta 4, using the Twenty Twenty Two theme included, on the home page (showing a list of all blog posts), the collection of posts is wrapped inside a
ul
and individually inli
tags. Looking at the editor and the source code, this is rendered by thecore/post-template
block.I expected the generated markup to have each posted wrapped in an
<article>
, such as what happens on the blog posts screen of the Twenty Twenty One theme:What is your proposed solution?
Though a list of blog posts is undoubtedly a list, my understanding is that
<article>
is the semantically appropriate choice.Should I be using some other kind of
core/post-template
block to achieve this? I had expected a setting to change the HTML tag(s) under the Advanced block settings, but there is not one.Other solution ideas:
query-loop
.core/post-template
have a Advanced setting to change the block tag?Thank you for your time,
The text was updated successfully, but these errors were encountered: