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

Query pagination does not output paged and paged-number body classes #34898

Open
carolinan opened this issue Sep 17, 2021 · 0 comments
Open

Query pagination does not output paged and paged-number body classes #34898

carolinan opened this issue Sep 17, 2021 · 0 comments
Labels
[Block] Query Pagination Affects the Query Pagination Block - used for pagination within the Query Loop Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.

Comments

@carolinan
Copy link
Contributor

carolinan commented Sep 17, 2021

What problem does this address?

In a PHP based theme the <body> includes the CSS classes paged and paged-number (paged-2) on archive pagination.
With the query and the query pagination block, these body classes are missing.

One use case would be to have a blog with one query for sticky posts, and one for regular posts, with different designs and inner blocks. And then hide the sticky posts on next pages.

I am now solving this by adding the body classes myself if the current url includes `?query-2-page'
But this means I have to change the query in my hack depending on which query id is used for that site or theme.

What is your proposed solution?

Somehow detect the pagination and add the body classes.

Related:
#32531

@carolinan carolinan added [Type] Enhancement A suggestion for improvement. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Block] Query Pagination Affects the Query Pagination Block - used for pagination within the Query Loop Block labels Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Pagination Affects the Query Pagination Block - used for pagination within the Query Loop Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

1 participant