Skip to content

Posts Block: post_class() nested inside <li> instead of being the outer container #813

@sheillaluciana

Description

@sheillaluciana

In 3.5.17 the Posts Block markup changed. Each post now renders like:

<ul>
  <li>
    <article <?php post_class(); ?>>…</article>
  </li>
</ul>

This differs from WordPress core where the element with post_class() is always the outer container (either <article> or <li>).

Because of this, existing CSS breaks. If list semantics are intended, shouldn’t post_class() be applied directly to <li> instead of nesting <article> inside it?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions