-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add community rough templates #88
Conversation
global $wp_query; | ||
|
||
// Add first-in-year and last-in-year to help put design elements in between year groups in the Month In WordPress category | ||
if ( is_object( $wp_query ) && $wp_query->post_count > 1 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the post-year-{date}
is enough to achieve this? Maybe something like this for the SVG "separator" image between years?
[class*="post-year-"]:last-of-type {
content: "";
background-image: url( 'images/foo.svg' );
}
Since post-year-
is targeted with a wildcard, it should match the last instance of post-year-2021
, post-year-2020
, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that might work, thanks! I'll leave in the first-in-year code in place for now with a note to remove it if it's not ultimately needed.
This doesn't work but it's surely part of the solution. I'm not sure what the blocker is here.
This uses the `category` pseudo-attribute from #88.
* Rough starting templates This is a starting point for the month-in-wordpress templates. There's no CSS changes yet, just the markup. Some notes: * The wp:query block has some limitations and oddities. I've set columns to 4 because otherwise it was only showing 2. Could be an off-by-one bug or just some quirky layout stuff. * I used perPage:10000. 0/-1 don't work like WP_Query. I'd prefer to set the limit to something like 60 (5 years per page), but it seems that the pagination block doesn't pay attention to the query block's page parameters and that would mean putting a magic number in two places. Probably there's a sensible way to handle that, but for now I've just removed the pagination altogether. * Limit the query to the right category This uses the `category` pseudo-attribute from #88. * Make headings links * Fix link colour, align text * Workaround for an issue in query handling There's a weird bug or unexpected behaviour around setting the query vars in this context. This isn't right but it'll look better for the demo. * Rough version of the in-between-years divider
This adds a very rough version of the Community category page.
There's lots that doesn't look right or work properly yet, but it's a starting point to work on.