Skip to content

Commit

Permalink
Rough starting templates
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tellyworth committed Nov 29, 2021
1 parent 6cf5835 commit 73d06e9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
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"} /--></h2>

<!-- wp:group {"className":"entry-meta"} -->
<div class="wp-block-group entry-meta">
<!-- wp:post-date {"format":"Y"} /-->
</div>
<!-- /wp:group -->
</header>
<!-- /wp:group -->
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":{"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 /-->

0 comments on commit 73d06e9

Please sign in to comment.