Browse Source

Date archives: classic date.php with card + year nav

- Add date.php (mirrors category.php) so year/month/day archives get the #dadada
  content card and white title-above, instead of falling through to the bare block
  templates/archive.html (which had no background). Classic date.php outranks the
  block archive template in the hierarchy, like the existing category.php/tag.php.
- Restore the year-to-year nav removed with the old archive.php: prev/next year via
  get_year_link(), based on the queried year, next hidden when it'd point at a future
  archive. Styled .dw-year-nav (white links on the dark archive body).
- Finish neutralizing the legacy single-article shell on archive/music: add
  box-shadow:none + zero the bottom padding so the article.single drop-shadow no
  longer draws a faint border below the card.
- page-archive.php: date format m/d/y -> y/m/d, matching the desk listing.
windhamdavid 1 day ago
parent
commit
d32404afe5
4 changed files with 69 additions and 5 deletions
  1. 48 0
      date.php
  2. 1 1
      page-archive.php
  3. 20 4
      style.css
  4. 0 0
      v4-style.min.css

+ 48 - 0
date.php

@@ -0,0 +1,48 @@
+<?php get_header(); ?>
+
+	<div class="container leader">
+		<div class="row">
+			<div class="col-md-12">
+				<h1 class="cm-sans fs-2 archive-heading animate__animated animate__fadeInLeft"><?php echo get_the_archive_title(); ?></h1>
+			</div>
+		</div>
+		<article id="content" class="single" role="main">
+			<div class="entry-content archive">
+				<?php if ( have_posts() ) : ?>
+				<?php while ( have_posts() ) : the_post(); ?>
+				<div class="col-sm-6">
+					<div class="entry-meta">
+						<div class="date">
+							<?php the_date(); ?>
+						</div>
+					</div>
+					<h4><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'dw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
+					<?php the_excerpt(); ?>
+				</div>
+				<?php endwhile; ?>
+				<div class="clear">&nbsp;</div>
+				<?php dw_paging_nav();
+				else :
+					printf( __( 'Nothing Found', 'dw' ));
+					get_search_form();
+				endif;
+				?>
+			</div>
+		</article>
+		<?php
+		// Year-to-year navigation (restored from the old archive.php). Based on the
+		// queried year so it works even for an empty year; the "next" link is hidden
+		// when it would point at a future (not-yet-existing) archive.
+		$this_year = (int) get_query_var( 'year' );
+		if ( ! $this_year ) { $this_year = (int) current_time( 'Y' ); }
+		$prev_year = $this_year - 1;
+		$next_year = $this_year + 1;
+		?>
+		<nav class="dw-year-nav" aria-label="Yearly archives">
+			<a class="dw-year-prev" href="<?php echo esc_url( get_year_link( $prev_year ) ); ?>">&larr; <?php echo $prev_year; ?></a>
+			<?php if ( $next_year <= (int) current_time( 'Y' ) ) : ?>
+			<a class="dw-year-next" href="<?php echo esc_url( get_year_link( $next_year ) ); ?>"><?php echo $next_year; ?> &rarr;</a>
+			<?php endif; ?>
+		</nav>
+	</div>
+<?php get_footer('full'); ?>

+ 1 - 1
page-archive.php

@@ -19,7 +19,7 @@ get_header(); ?>
 						<h5>Posts</h5>
 						<h5>Posts</h5>
 						<ul>
 						<ul>
 							<?php $recentposts = get_posts(array( 'numberposts' => -1, 'offset' => 0 ) ); foreach ($recentposts as $post) : setup_postdata($post); ?>
 							<?php $recentposts = get_posts(array( 'numberposts' => -1, 'offset' => 0 ) ); foreach ($recentposts as $post) : setup_postdata($post); ?>
-							       <li style="color:#777"><?php echo get_the_date('m/d/y'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
+							       <li style="color:#777"><?php echo get_the_date('y/m/d'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
 							<?php endforeach; ?>
 							<?php endforeach; ?>
 						</ul>
 						</ul>
 					</div>
 					</div>

+ 20 - 4
style.css

@@ -1270,14 +1270,17 @@ body.sitemap .container.leader {
 	width: auto;
 	width: auto;
 	max-width: 1280px;
 	max-width: 1280px;
 }
 }
-/* Neutralize the legacy single-article shell (white bg + 70/140px padding + 100px top
-   margin) so the #dadada card sits directly under the title on the dark body, spanning
-   the full leader width โ€” matching desk. */
+/* Neutralize the legacy single-article shell (white bg + drop-shadow + 70/140px
+   padding + 100px top margin) so the #dadada card sits directly under the title on
+   the dark body, spanning the full leader width โ€” matching desk. Without box-shadow:none
+   the article.single shadow lingers and, with the bottom padding, draws a faint border
+   below the card. */
 body.music article#content,
 body.music article#content,
 body.archive article#content {
 body.archive article#content {
 	background: transparent;
 	background: transparent;
+	box-shadow: none;
 	margin-top: 0;
 	margin-top: 0;
-	padding: 0 0 3rem;
+	padding: 0;
 }
 }
 .music-heading,
 .music-heading,
 .archive-heading,
 .archive-heading,
@@ -1286,6 +1289,19 @@ body.archive article#content {
 	color: #fff;
 	color: #fff;
 	font-size: 28px;
 	font-size: 28px;
 }
 }
+/* Year-to-year navigation below the date-archive card (date.php) โ€” white links on
+   the dark body.archive bg, prev left / next right. */
+.dw-year-nav {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	margin: 1.5rem 0 3rem;
+	font-family: 'Playfair Display', serif;
+	font-weight: 700;
+	font-size: 1.35rem;
+}
+.dw-year-nav a { color: #fff; }
+.dw-year-nav a:hover { color: #1a8; }
 #music.entry-content,
 #music.entry-content,
 body.archive .entry-content {
 body.archive .entry-content {
 	background: #dadada;
 	background: #dadada;

File diff suppressed because it is too large
+ 0 - 0
v4-style.min.css


Some files were not shown because too many files changed in this diff