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

Tenaz: Use one query block per section in front page template #7831

Closed
wants to merge 1 commit into from

Conversation

creativecoder
Copy link
Contributor

Changes proposed in this Pull Request:

  • Simplifies the front page template of the Tenaz theme to use one query loop block per section
  • Uses CSS to replicate that layout
Before After
image image

@creativecoder creativecoder self-assigned this May 24, 2024
Copy link
Contributor

Preview changes

I've detected changes to the following themes in this PR: Tenaz.

You can preview these changes by following the links below:

I will update this comment with the latest preview links as you push more changes to this PR.
⚠️ Note: The preview sites are created using WordPress Playground. You can add content, edit settings, and test the themes as you would on a real site, but please note that changes are not saved between sessions.

⚠️ Note: Child themes are dependent on their parent themes. You will have to install the parent theme as well for the preview to work correctly.

@mikachan mikachan requested a review from iamtakashi May 25, 2024 14:22
@iamtakashi
Copy link
Contributor

Interesting! I don't know how I feel about the necessity of using CSS to control the font size and hide the excerpt, though. Having a single query loop block allows pagination to work, but I'm not sure if we want to pay that price to have a pagination in this specific theme.

Also, on the front of the site, I can see one extra post appears. It seems like the number of sticky post is added to the number of posts specified in the query loop block. This isn't caused by this PR, but it surfaced the issue.

CleanShot 2024-05-28 at 18 44 48@2x

@creativecoder
Copy link
Contributor Author

creativecoder commented May 31, 2024

Thanks for taking a look @iamtakashi !

This is definitely an experiment, and I'm also unsure it's worth the tradeoff of simplifying the block layout for the template. As you point out, hiding the excerpt feels particularly hacky.

Another idea that occurred to me is to enhance the Query Loop block so that it can support multiple Post Template child blocks. This way you could apply different layouts to different posts in a single loop (the Post Template block would need some way to target a subset of the posts query, maybe something like the CSS nth-child syntax). But that would add a lot of complexity, so again I'm not sure it's a worthy tradeoff.

I'll open an issue or discussion in Gutenberg and see if there are other ideas for how the Query Loop could better handle multiple layouts for a single query.

With a quick search, I did find another idea: Query Loop Block: Adding Multiple Query Loop Blocks with the option to not repeat posts already shown by previous Query Loop on same page #40903

@creativecoder creativecoder marked this pull request as draft May 31, 2024 01:16
@creativecoder
Copy link
Contributor Author

I converted this to a draft to indicate it's still experimental.

@creativecoder
Copy link
Contributor Author

Closing this until there's a better solution on the editor side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants