-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rough starting template for month in WP (#81)
* 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
- Loading branch information
1 parent
52684b4
commit b73fca9
Showing
4 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...tent/themes/wporg-news-2021/block-template-parts/content-category-month-in-wordpress.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- wp:group {"tagName":"header","className":"entry-header"} --> | ||
<header class="wp-block-group entry-header"> | ||
<h2><!-- wp:post-date {"format":"M","isLink":true} /--></h2> | ||
|
||
<!-- wp:group {"className":"entry-meta"} --> | ||
<div class="wp-block-group entry-meta"> | ||
<!-- wp:post-date {"format":"Y"} /--> | ||
</div> | ||
<!-- /wp:group --> | ||
</header> | ||
<!-- /wp:group --> |
16 changes: 16 additions & 0 deletions
16
source/wp-content/themes/wporg-news-2021/block-templates/category-month-in-wordpress.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- wp:template-part {"slug":"header","align":"full","className":"site-header-container"} /--> | ||
<!-- This is a hack to ensure content isn't covered by the fixed header --> | ||
<!-- wp:template-part {"slug":"header","align":"full","className":"site-header-offset"} /--> | ||
|
||
<!-- wp:query {"tagName":"main","className":"site-content-container","displayLayout":{"type":"flex","columns":4},"query":{"category":"month-in-wordpress","perPage":"10000","inherit":false}} --> | ||
<main class="wp-block-query site-content-container"> | ||
<!-- wp:post-template --> | ||
<!-- wp:template-part {"slug":"content-category-month-in-wordpress","tagName":"article","layout":{"inherit":true}} /--> | ||
<!-- /wp:post-template --> | ||
|
||
</main> | ||
<!-- /wp:query --> | ||
|
||
<!-- wp:template-part {"tagName":"footer","slug":"footer-archive","className":"footer-archive","layout":{"inherit":true}} /--> | ||
|
||
<!-- wp:wporg/global-footer /--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters