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

Rough starting template for month in WP #81

Merged
merged 6 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"} /-->
tellyworth marked this conversation as resolved.
Show resolved Hide resolved
</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":{"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 -->

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing we'd want to keep the query navigation template part.

The links are broken at the moment, but that'll be fixed in #70 and #80

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could leave it off for this template, since there's only ~100 posts, but we'll have to get it working for other templates, and I'm guessing the same solution would work here too

</main>
<!-- /wp:query -->

<!-- wp:template-part {"tagName":"footer","slug":"footer-archive","className":"footer-archive","layout":{"inherit":true}} /-->

<!-- wp:wporg/global-footer /-->
6 changes: 3 additions & 3 deletions source/wp-content/themes/wporg-news-2021/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ function specify_post_classes( $classes, $extra_classes, $post_id ) {
if ( !is_null( $current_post ) ) {
if ( $current_post == 0 ) {
// First in the query
$classes[] = 'first-in-year';
} elseif ( $current_post >= $wp_query->post_count - 1 ) {
#$classes[] = 'first-in-year first-in-query';
} elseif ( $current_post >= count( $wp_query->posts ) - 1 ) {
// Last in the query
$classes[] = 'last-in-year';
#$classes[] = 'last-in-year last-in-query';
} else {
if ( get_the_date( 'Y' ) !== get_the_date( 'Y', $wp_query->posts[ $current_post - 1 ] ) ) {
$classes[] = 'first-in-year';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,29 @@ body.category-releases {

body.category-month-in-wordpress {
@extend %local-header-dark;
text-align: center;

.site-content-container {
color: var( --wp--preset--color--off-white-2 );
}

.wp-block-post-date a {
color: var( --wp--preset--color--off-white-2 );
text-transform: uppercase;
}

.last-in-year::after {
content: "-";
display: inline-block;
line-height: 7em;
width: 100%;
background-image: url("images/brush-stroke-short-blue-4.svg");
background-position: center;
background-repeat: no-repeat;
//background-size: fill;
color: var(--wp--preset--color--blue-1);

}
@extend %footer-archive-dark;
}

Expand Down