Skip to content
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

columns-{columns} class no longer applied to Query Loop / Post Template #51346

Closed
justintadlock opened this issue Jun 8, 2023 · 4 comments · Fixed by #51358
Closed

columns-{columns} class no longer applied to Query Loop / Post Template #51346

justintadlock opened this issue Jun 8, 2023 · 4 comments · Fixed by #51358
Assignees
Labels
[Block] Post Template Affects the Post Template Block [Block] Query Loop Affects the Query Loop Block [Type] Regression Related to a regression in the latest release

Comments

@justintadlock
Copy link
Contributor

With the change from Flex to the Grid layout with the Query Loop + Post Template blocks in #49050, the columns-{columns} class was removed here. This means that theme authors can no longer target queries via custom block styles based on the column number.

Previously, the Post Template block's output would look something like this for a three-column layout:

<ul class="is-flex-container columns-3 wp-block-post-template is-layout-flow wp-block-post-template-is-layout-flow">

Today, it looks like this:

<ul class="wp-block-post-template is-layout-grid wp-container-34 wp-block-post-template-is-layout-grid">

The new gap support is much needed, so I don't think this needs to be reverted. We just need to add the columns-{columns} class back in unless there is a technical reason not to do so (didn't see this mentioned anywhere in the PR).

@justintadlock justintadlock added [Type] Regression Related to a regression in the latest release [Block] Query Loop Affects the Query Loop Block [Block] Post Template Affects the Post Template Block labels Jun 8, 2023
@ndiego
Copy link
Member

ndiego commented Jun 8, 2023

@tellthemachines @andrewserong any ideas on this one?

@andrewserong
Copy link
Contributor

andrewserong commented Jun 8, 2023

I think it should be possible to add these classnames back in at render time. I'll have a play and try it out! Thanks for raising the issue @justintadlock 👍

@andrewserong
Copy link
Contributor

I've opened a potential fix over in #51358.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jun 8, 2023
@justintadlock
Copy link
Contributor Author

Awesome! Great work, @andrewserong.

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Template Affects the Post Template Block [Block] Query Loop Affects the Query Loop Block [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants