Browse Source

Guest book, contact/archive page formats, front-page zoom + About link

- Guest book: publish Gravity Forms "Guest" (form 2) active entries below the form on
  /contact/guests as a striped WP table (name/location/website/message, no email).
  Registered early in functions.php because the block-theme content renders before
  wp_enqueue_scripts (render_block on core/post-content). Styles in css/form.css.
- Contact page: dark body + white "Contact" title + #dadada card (info left, form right),
  matching the other pages; dropped the body.contact light-bg override.
- Archive page: same page format — leader width, white title, #dadada card, transparent
  legacy article shell.
- Front page: zoom transition now fires on the Zeken Woozer and David A. Windham cards;
  David A. Windham links to /about; removed the bottom About link.
- Desk: emoji on the Scroll/Archive buttons.
- Rebuilt v4-style.min.css + v4-front.min.js.
windhamdavid 1 week ago
parent
commit
f6cf6183c6
10 changed files with 134 additions and 30 deletions
  1. 20 1
      css/form.css
  2. 1 2
      front-page.php
  3. 74 0
      functions.php
  4. 1 1
      js/front-page.js
  5. 0 0
      js/v4-front.min.js
  6. 7 5
      page-archive.php
  7. 7 9
      page-contact.php
  8. 2 2
      page-desk.php
  9. 22 10
      style.css
  10. 0 0
      v4-style.min.css

+ 20 - 1
css/form.css

@@ -4364,4 +4364,23 @@ to no.
         top: 12px;
     }
 
- }
+ }
+/* ---- Guest Book: form-2 entries in a striped table below the form (/contact/guests) ---- */
+.dw-guestbook { margin-top: 2.5rem; }
+.dw-guestbook-title { font-weight: 700; margin: 0 0 1rem; }
+.dw-guestbook .wp-block-table { margin: 0; overflow-x: auto; }
+.dw-guestbook table { width: 100%; border-collapse: collapse; font-size: 1.15rem; line-height: 1.5; }
+.dw-guestbook thead th {
+  text-align: left;
+  padding: 0.7rem 0.95rem;
+  font-weight: 700;
+  border-bottom: 2px solid #a9a9a9;
+}
+.dw-guestbook tbody td { padding: 0.7rem 0.95rem; vertical-align: top; border: 0; }
+/* Alternating row backgrounds (override core is-style-stripes with matching specificity). */
+.dw-guestbook .is-style-stripes tbody tr:nth-child(odd),
+.dw-guestbook tbody tr:nth-child(odd) { background: #ececec; }
+.dw-guestbook .is-style-stripes tbody tr:nth-child(even),
+.dw-guestbook tbody tr:nth-child(even) { background: #d4d4d4; }
+.dw-guestbook a { color: #1a8f74; }
+.dw-guestbook a:hover { color: #25c2a0; }

+ 1 - 2
front-page.php

@@ -72,7 +72,7 @@
 			<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
 				<h4><span itemprop="addressLocality">Greenwood</span>, <span class="p-region" itemprop="addressRegion">South Carolina</span> <span class="p-country-name" itemprop="addressCountry">USA</span></h4>
 			</div>
-			<h3><span itemprop="name" class="author p-name"><a class="u-url dw-card" itemprop="url" href="https://davidwindham.com/" title="David A. Windham" rel="home">David A. Windham</a></span></h3>
+			<h3><span itemprop="name" class="author p-name"><a class="u-url dw-card" itemprop="url" href="<?php echo home_url( '/' ); ?>about" title="David A. Windham" rel="home">David A. Windham</a></span></h3>
 			<p class="p-job-title screen-reader-text" itemprop="description">au&middot;to&middot;di&middot;dact &nbsp; rac&middot;on&middot;teur</p>
 			<div class="contact-info"><span class="p-tel" itemprop="telephone"><a class="phone-card" href="tel:8037123283">803-712-3283</a></span></p>
 				<h4><span class="u-email mail-card" itemprop="email">
@@ -102,7 +102,6 @@
 			</div>-->
 			<nav class="card-bottom" role="navigation">
 				<p>
-					<a class="about-card" href="<?php echo home_url( '/' ); ?>about" class="list-group-item">About</a> -
 					<a class="desk-card" href="<?php echo home_url( '/' ); ?>desk" class="list-group-item">Desk</a> -
 					<a class="studio-card" href="<?php echo home_url( '/' ); ?>studio" class="list-group-item">Studio</a> -
 					<a class="work-card" href="<?php echo home_url( '/' ); ?>work" class="list-group-item">Work</a>

+ 74 - 0
functions.php

@@ -56,6 +56,80 @@ function dw_remove_block_library_css(){
 }
 //add_action( 'wp_enqueue_scripts', 'dw_remove_block_library_css' );
 
+/*  Guest Book — publish the "Guest" Gravity Form (id 2) entries below the form on
+    /contact/guests: 4 Name · 6 Location · 9 Website · 10 Message (Email (7) is never
+    shown; active entries only). Registered here rather than in the late-loaded
+    inc/form.php because this block theme renders the page content BEFORE
+    wp_enqueue_scripts, so the render_block hook has to be attached early.  */
+function dw_guestbook() {
+	if ( ! class_exists( 'GFAPI' ) ) {
+		return '';
+	}
+	$entries = GFAPI::get_entries(
+		2,
+		array( 'status' => 'active' ),
+		array( 'key' => 'date_created', 'direction' => 'DESC' ),
+		array( 'offset' => 0, 'page_size' => 200 )
+	);
+	if ( is_wp_error( $entries ) || empty( $entries ) ) {
+		return '';
+	}
+
+	$rows = '';
+	foreach ( $entries as $e ) {
+		$name = trim( rgar( $e, '4' ) );
+		$loc  = trim( rgar( $e, '6' ) );
+		$web  = trim( rgar( $e, '9' ) );
+		$msg  = trim( rgar( $e, '10' ) );
+		if ( $name === '' && $msg === '' ) {
+			continue;
+		}
+		$weblink = '';
+		if ( $web !== '' ) {
+			$href = esc_url( $web );
+			if ( $href !== '' ) {
+				$label   = preg_replace( '#^https?://(www\.)?#i', '', untrailingslashit( $web ) );
+				$weblink = '<a href="' . $href . '" target="_blank" rel="nofollow ugc noopener">' . esc_html( $label ) . '</a>';
+			}
+		}
+		$rows .= '<tr>'
+			. '<td data-label="Name">' . esc_html( $name ) . '</td>'
+			. '<td data-label="Location">' . esc_html( $loc ) . '</td>'
+			. '<td data-label="Website">' . $weblink . '</td>'
+			. '<td data-label="Message">' . nl2br( esc_html( $msg ) ) . '</td>'
+			. '<td data-label="Date">' . esc_html( mysql2date( 'M Y', $e['date_created'] ) ) . '</td>'
+			. '</tr>';
+	}
+	if ( $rows === '' ) {
+		return '';
+	}
+	return '<div class="dw-guestbook">'
+		. '<h3 class="dw-guestbook-title">Guest Book</h3>'
+		. '<figure class="wp-block-table is-style-stripes"><table>'
+		. '<thead><tr>'
+		. '<th scope="col">Name</th><th scope="col">Location</th><th scope="col">Website</th>'
+		. '<th scope="col">Message</th><th scope="col">Date</th>'
+		. '</tr></thead>'
+		. '<tbody>' . $rows . '</tbody>'
+		. '</table></figure></div>';
+}
+function dw_guestbook_once() {
+	static $done = false;
+	if ( $done ) {
+		return '';
+	}
+	$done = true;
+	return dw_guestbook();
+}
+add_shortcode( 'dw_guestbook', 'dw_guestbook' );
+add_filter( 'render_block', 'dw_guestbook_render_block', 10, 2 );
+function dw_guestbook_render_block( $block_content, $block ) {
+	if ( ! empty( $block['blockName'] ) && 'core/post-content' === $block['blockName'] && is_page( 'guests' ) ) {
+		$block_content .= dw_guestbook_once();
+	}
+	return $block_content;
+}
+
 add_action( 'wp_enqueue_scripts', 'dw_scripts' );
 function dw_scripts() {
 	global $post;

+ 1 - 1
js/front-page.js

@@ -68,7 +68,7 @@ $(document).ready(function(){
 
 	// Zoom-into-card page transition: clicking a home nav-card scales the white card
 	// up until it fills the screen (fading the inner content), then navigates.
-	$( "a.about-card, a.desk-card, a.studio-card, a.work-card" ).on('click', function (e) {
+	$( "a.zw-card, a.dw-card, a.desk-card, a.studio-card, a.work-card" ).on('click', function (e) {
 		var href = this.getAttribute('href');
 		if (!href) return;
 		e.preventDefault();

File diff suppressed because it is too large
+ 0 - 0
js/v4-front.min.js


+ 7 - 5
page-archive.php

@@ -5,13 +5,15 @@ Template Name: Posts
 
 get_header(); ?>
 
-	<div class="container">
+	<div class="container leader">
+		<div class="row">
+			<div class="col-md-12">
+				<h1 class="cm-sans fs-2 archive-heading animate__animated animate__fadeInLeft">Archive</h1>
+			</div>
+		</div>
 		<article id="content" class="single" role="main">
 			<div class="entry-content">
-				<header class="page-header">
-					<h1 class="cm-sans">Archive</h1>
-					<p>This is a list of every posts, til (today I learned), and bookmark I've published on this website. There a many other pages published on subdomains and elsewhere on this website. For a list of everything published on the website, please see the <a href="<?php echo site_url(); ?>/sitemap">sitemap</a>.</p>
-				</header>
+				<p>This is a list of every posts, til (today I learned), and bookmark I've published on this website. There a many other pages published on subdomains and elsewhere on this website. For a list of everything published on the website, please see the <a href="<?php echo site_url(); ?>/sitemap">sitemap</a>.</p>
 				<div class="row">
 					<div class="col-md-6">
 						<h5>Posts</h5>

+ 7 - 9
page-contact.php

@@ -1,9 +1,13 @@
 <?php get_header(); ?>
-	<div class="container" role="main">
+	<div class="container leader" role="main">
+		<div class="row">
+			<div class="col-md-12">
+				<h1 class="cm-sans fs-2 contact-heading animate__animated animate__fadeInLeft">Contact</h1>
+			</div>
+		</div>
 		<div id="content" class="single">
-			<div class="row mt-5 pt-5" style="padding:50px 0;">
+			<div class="row">
 				<div class="col-sm-4">
-					<h2 class="entry-title">Contact</h2>
 					<h5 class="lead">Questions? Say Hello.</h5>
 					<p>Please provide as much information as possible so that I can save us both some time with an adequate response.</p>
 
@@ -45,12 +49,6 @@
 					<?php gravity_form(1, false, false, false, '', false); ?>
 				</div>
 			</div>
-			<div class="row my-5" style="margin-top:100px 0;">
-					<p>&nbsp;</p>
-			</div>
-			<div class="row my-5" style="margin-top:100px 0;">
-					<p>&nbsp;</p>
-			</div>
 		</div>
 	</div>
 

+ 2 - 2
page-desk.php

@@ -125,8 +125,8 @@ get_header(); ?>
 				</div>
 				<div class="d-flex desk-actions" style="width:100%;margin-top:3rem;justify-content:flex-start;align-items:center;flex-wrap:wrap;gap:.5rem">
 					<div style="flex:0 0 280px"><?php get_search_form(); ?></div>
-					<a href="/desk/posts/" type="button" class="btn btn-dark">The Scroll</a>
-					<a href="/archive/" type="button" class="btn btn-dark">👉🏼 The Archive</a>
+					<a href="/desk/posts/" type="button" class="btn btn-dark">📜 The Scroll</a>
+					<a href="/archive/" type="button" class="btn btn-dark">🗄️ The Archive</a>
 				</div>
 			</div>
 		</div>

+ 22 - 10
style.css

@@ -76,11 +76,8 @@ body.sitemap {
 	body.sitemap .site-title a {
 		color:#fff;
 	}
-body.contact {
-	background-color: #F6F6F6;
-}
 	body.contact .site-title a {
-		color:#000 !important; /* beat .light{color:#fcfcfc!important} — contact has a light bg */
+		color:#fff;
 	}
 
 /*============================================
@@ -1234,28 +1231,43 @@ body.desk .entry-content {
   width: calc((100% - 24px) / 5);
   -webkit-text-size-adjust: none;
 }
-/* Music page — light content card + 1280 leader width + white title over the dark
-   body.page bg, consistent with the desk / projects / block pages. */
-body.music .container.leader {
+/* Music + Archive pages — light content card + 1280 leader width + white title over the
+   dark body.page bg, consistent with the desk / projects / block pages. */
+body.music .container.leader,
+body.archive .container.leader,
+body.contact .container.leader {
 	width: auto;
 	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. */
-body.music article#content {
+body.music article#content,
+body.archive article#content {
 	background: transparent;
 	margin-top: 0;
 	padding: 0 0 3rem;
 }
-.music-heading {
+.music-heading,
+.archive-heading,
+.contact-heading {
 	color: #fff;
 	font-size: 28px;
 }
-#music.entry-content {
+#music.entry-content,
+body.archive .entry-content {
+	background: #dadada;
+	padding: 96px;
+	border-radius: 6px;
+}
+/* Contact page — #content itself is the card (no inner .entry-content wrapper).
+   Override the legacy single-article 100px top margin so the card sits under the title. */
+body.contact #content {
 	background: #dadada;
 	padding: 96px;
 	border-radius: 6px;
+	margin-top: 1.25rem;
+	margin-bottom: 3rem;
 }
 /* "Daveo Radio" CTA — playback now lives on /radio, so the Music page links there. */
 .daveo-radio-btn {

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