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

Add community rough templates #88

Merged
merged 9 commits into from
Nov 29, 2021
Merged

Conversation

tellyworth
Copy link
Contributor

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.

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 ) {
Copy link
Member

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.

Copy link
Contributor Author

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.

@tellyworth tellyworth merged commit 6cf5835 into trunk Nov 29, 2021
tellyworth added a commit that referenced this pull request Nov 29, 2021
This uses the `category` pseudo-attribute from #88.
@ryelle ryelle deleted the add/community-rough-templates branch December 7, 2021 16:58
tellyworth added a commit that referenced this pull request Dec 9, 2021
* 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
@iandunn iandunn mentioned this pull request Dec 15, 2021
6 tasks
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