Description
The value of styles.blocks.core/query.css in theme.json is not added to the webpage when:
- There is a
core/query block
- No
core/query block has enhancedPagination set to true
In PHP render code for the core/query block, it removes the wp-block-query style if no blocks are using interactive pagination. However, this prevents any CSS defined in theme.json's styles.blocks.core/query.css from being included. This is because this CSS is added as inline CSS based on if the same wp-block-query style asset has been enqueued.
Step-by-step reproduction instructions
- Install WordPress 6.7.1 with default Twenty Twenty-Five theme.
- Edit the
theme.json to add in styles.blocks:
"core/query": {
"css": "background-color: pink"
}
- View the homepage and see that the CSS is not applied.
- Hit Edit Site in the toolbar or edit the Blog Home template.
- Notice the CSS is applied in the block editor.
- Remove the Content block from inside the Query Loop block.
- Select the Query Loop block and disable the Reload full page option.
- Save.
- View the homepage and see that the CSS is applied.
Screenshots, screen recording, code snippet
| `enhancedPagination:false` |
`enhancedPagination:true` |
|

|

|
|
Missing in the global styles inline CSS.
<style id='global-styles-inline-css'>
…
:root :where(.wp-block-post-title a:where(:not(.wp-element-button)):hover){text-decoration: underline;}
:root :where(.wp-block-query-pagination){font-size: var(--wp--preset--font-size--medium);font-weight: 500;}
…
</style>
|
Present in the global styles inline CSS.
<style id='global-styles-inline-css'>
…
:root :where(.wp-block-post-title a:where(:not(.wp-element-button)):hover){text-decoration: underline;}
:root :where(.wp-block-query){background-color: pink}
:root :where(.wp-block-query-pagination){font-size: var(--wp--preset--font-size--medium);font-weight: 500;}
…
</style>
|
Environment info
- WordPress 6.7.1, Twenty Twenty Five 1.0
- Firefox 133.0.3 (64-bit), Chrome 131.0.6778.264 (Official Build) (64-bit)
- Windows 11
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
Description
The value of
styles.blocks.core/query.cssintheme.jsonis not added to the webpage when:core/queryblockcore/queryblock hasenhancedPaginationset totrueIn PHP render code for the
core/queryblock, it removes thewp-block-querystyle if no blocks are using interactive pagination. However, this prevents any CSS defined intheme.json'sstyles.blocks.core/query.cssfrom being included. This is because this CSS is added as inline CSS based on if the samewp-block-querystyle asset has been enqueued.Step-by-step reproduction instructions
theme.jsonto add instyles.blocks:Screenshots, screen recording, code snippet
Missing in the global styles inline CSS.
Present in the global styles inline CSS.
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.