Add sticky header, customizer hero background image, and cinematic post image styles

This commit is contained in:
Adolfo Reyna
2026-03-12 23:34:08 -04:00
parent c4a6f2f4ab
commit d4d53ca56b
4 changed files with 183 additions and 38 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 MiB

View File

@@ -3,9 +3,12 @@
* The front page template file. * The front page template file.
*/ */
get_header(); ?> get_header();
<section class="hero-section"> $hero_bg = get_theme_mod( 'hero_background_image', get_template_directory_uri() . '/assets/images/hero-default.png' );
?>
<section class="hero-section" style="background-image: url('<?php echo esc_url( $hero_bg ); ?>'); background-size: cover; background-position: center;">
<div class="hero-content"> <div class="hero-content">
<h1 class="hero-headline"><?php echo get_theme_mod( 'hero_headline', 'Ancient Wisdom for a Modern World.' ); ?></h1> <h1 class="hero-headline"><?php echo get_theme_mod( 'hero_headline', 'Ancient Wisdom for a Modern World.' ); ?></h1>
<p class="hero-subheadline"><?php echo get_theme_mod( 'hero_subheadline', 'A collection of biblical insights curated for the thoughtful leader.' ); ?></p> <p class="hero-subheadline"><?php echo get_theme_mod( 'hero_subheadline', 'A collection of biblical insights curated for the thoughtful leader.' ); ?></p>

View File

@@ -81,6 +81,17 @@ function wisdom1_customize_register( $wp_customize ) {
'section' => 'wisdom1_hero_section', 'section' => 'wisdom1_hero_section',
'type' => 'text', 'type' => 'text',
) ); ) );
// Hero Background Image Setting
$wp_customize->add_setting( 'hero_background_image', array(
'default' => get_template_directory_uri() . '/assets/images/hero-default.png',
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hero_background_image', array(
'label' => __( 'Hero Background Image', 'wisdom1' ),
'section' => 'wisdom1_hero_section',
'settings' => 'hero_background_image',
) ) );
} }
add_action( 'customize_register', 'wisdom1_customize_register' ); add_action( 'customize_register', 'wisdom1_customize_register' );

203
style.css
View File

@@ -1,11 +1,15 @@
/* /*
Theme Name: Wisdom1 Theme Name: Wisdom1
Description: A modern-classic Christian blog theme for "Wisdom for the Kingdom". Description: A modern-classic Christian blog theme for "Wisdom for the Kingdom".
Version: 1.2.1 Version: 1.2.2
Text Domain: wisdom1 Text Domain: wisdom1
*/ */
/* --- 1. Base Reset & Typography --- */ /* --- 1. Base Reset & Typography --- */
* {
box-sizing: border-box;
}
body { body {
margin: 0; margin: 0;
background-color: var(--wp--preset--color--base); background-color: var(--wp--preset--color--base);
@@ -14,6 +18,7 @@ body {
font-size: var(--wp--preset--font-size--body); font-size: var(--wp--preset--font-size--body);
line-height: 1.6; line-height: 1.6;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
overflow-x: hidden;
} }
.site-container { .site-container {
@@ -22,10 +27,20 @@ body {
padding: 0 var(--wp--preset--spacing--50); padding: 0 var(--wp--preset--spacing--50);
} }
img {
max-width: 100%;
height: auto;
display: block;
}
/* --- 2. Header & Navigation --- */ /* --- 2. Header & Navigation --- */
.site-header { .site-header {
padding: var(--wp--preset--spacing--30) 0; padding: var(--wp--preset--spacing--30) 0;
background-color: var(--wp--preset--color--base); background-color: var(--wp--preset--color--base);
position: sticky;
top: 0;
z-index: 1000;
border-bottom: 1px solid var(--wp--preset--color--border);
} }
.header-container { .header-container {
@@ -52,6 +67,7 @@ body {
border: 2px solid var(--wp--preset--color--primary); border: 2px solid var(--wp--preset--color--primary);
width: 40px; width: 40px;
height: 40px; height: 40px;
flex-shrink: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -71,16 +87,19 @@ body {
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
flex-wrap: wrap;
justify-content: center;
} }
.main-navigation a { .main-navigation a {
font-family: var(--wp--preset--font-family--body-font); font-family: var(--wp--preset--font-family--body-font);
font-size: 14px; font-size: 13px;
font-weight: 700; font-weight: 700;
text-transform: uppercase; text-transform: uppercase;
color: var(--wp--preset--color--primary); color: var(--wp--preset--color--primary);
text-decoration: none; text-decoration: none;
transition: color 0.3s ease; transition: color 0.3s ease;
white-space: nowrap;
} }
.main-navigation a:hover { .main-navigation a:hover {
@@ -89,23 +108,42 @@ body {
/* --- 3. Hero Section (Landing Page) --- */ /* --- 3. Hero Section (Landing Page) --- */
.hero-section { .hero-section {
height: 80vh; min-height: 80vh;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
background-color: var(--wp--preset--color--base); background-color: var(--wp--preset--color--base);
padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
position: relative;
}
.hero-section::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(244, 241, 234, 0.6); /* Antique Parchment with transparency */
z-index: 1;
}
.hero-content {
position: relative;
z-index: 2;
} }
.hero-headline { .hero-headline {
font-family: var(--wp--preset--font-family--header-font); font-family: var(--wp--preset--font-family--header-font);
font-size: var(--wp--preset--font-size--heading); font-size: clamp(2.5rem, 8vw, var(--wp--preset--font-size--heading));
margin-bottom: var(--wp--preset--spacing--30); margin-bottom: var(--wp--preset--spacing--30);
color: var(--wp--preset--color--primary); color: var(--wp--preset--color--primary);
line-height: 1.1;
} }
.hero-subheadline { .hero-subheadline {
font-size: var(--wp--preset--font-size--subheading); font-size: clamp(1.125rem, 4vw, var(--wp--preset--font-size--subheading));
margin-bottom: var(--wp--preset--spacing--50); margin-bottom: var(--wp--preset--spacing--50);
max-width: 600px; max-width: 600px;
margin-left: auto; margin-left: auto;
@@ -134,32 +172,35 @@ body {
.category-header { .category-header {
background-color: var(--wp--preset--color--primary); background-color: var(--wp--preset--color--primary);
color: white; color: white;
padding: var(--wp--preset--spacing--70) 0; padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
text-align: center; text-align: center;
margin-bottom: var(--wp--preset--spacing--70);
} }
.category-title { .category-title {
font-family: var(--wp--preset--font-family--header-font); font-family: var(--wp--preset--font-family--header-font);
font-size: var(--wp--preset--font-size--heading); font-size: clamp(2rem, 6vw, var(--wp--preset--font-size--heading));
margin: 0; margin: 0;
} }
.category-description { .category-description {
font-size: var(--wp--preset--font-size--subheading); font-size: clamp(1rem, 3vw, var(--wp--preset--font-size--subheading));
margin-top: 20px; margin-top: 20px;
opacity: 0.8; opacity: 0.8;
max-width: 800px;
margin-left: auto;
margin-right: auto;
} }
/* --- 5. Insights Grid --- */ /* --- 5. Insights Grid --- */
.section-header { .section-header {
text-align: center; text-align: center;
margin: var(--wp--preset--spacing--70) 0; margin: var(--wp--preset--spacing--70) 0;
padding: 0 var(--wp--preset--spacing--50);
} }
.section-title { .section-title {
font-family: var(--wp--preset--font-family--header-font); font-family: var(--wp--preset--font-family--header-font);
font-size: 36px; font-size: clamp(1.75rem, 5vw, 36px);
margin-bottom: 10px; margin-bottom: 10px;
} }
@@ -170,7 +211,7 @@ body {
.insights-grid { .insights-grid {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: var(--wp--preset--spacing--50); gap: var(--wp--preset--spacing--50);
margin-bottom: var(--wp--preset--spacing--90); margin-bottom: var(--wp--preset--spacing--90);
} }
@@ -180,18 +221,19 @@ body {
padding: var(--wp--preset--spacing--50); padding: var(--wp--preset--spacing--50);
border: 1px solid var(--wp--preset--color--border); border: 1px solid var(--wp--preset--color--border);
transition: border-color 0.3s ease; transition: border-color 0.3s ease;
display: flex;
flex-direction: column;
} }
.insight-card:hover { .insight-card:hover {
border-color: var(--wp--preset--color--hover); border-color: var(--wp--preset--color--hover);
} }
.insight-card .entry-title a { .insight-card .post-thumbnail img {
color: var(--wp--preset--color--primary); width: 100%;
text-decoration: none; aspect-ratio: 16 / 9;
font-family: var(--wp--preset--font-family--header-font); object-fit: cover;
font-size: 24px; margin-bottom: 20px;
line-height: 1.2;
} }
.insight-card .entry-title a:hover { .insight-card .entry-title a:hover {
@@ -220,18 +262,20 @@ body {
.reading-container { .reading-container {
max-width: 680px; max-width: 680px;
margin: 0 auto; margin: 0 auto;
font-size: 20px; font-size: clamp(1.125rem, 4vw, 20px);
line-height: 1.8; line-height: 1.8;
padding: 0 var(--wp--preset--spacing--50);
} }
.single-entry-header { .single-entry-header {
text-align: center; text-align: center;
margin-bottom: var(--wp--preset--spacing--70); margin-bottom: var(--wp--preset--spacing--70);
padding: 0 var(--wp--preset--spacing--50);
} }
.single-title { .single-title {
font-family: var(--wp--preset--font-family--header-font); font-family: var(--wp--preset--font-family--header-font);
font-size: 56px; font-size: clamp(2rem, 7vw, 56px);
margin-top: 10px; margin-top: 10px;
line-height: 1.1; line-height: 1.1;
} }
@@ -239,29 +283,84 @@ body {
.single-post-thumbnail { .single-post-thumbnail {
margin-bottom: var(--wp--preset--spacing--70); margin-bottom: var(--wp--preset--spacing--70);
text-align: center; text-align: center;
width: 100%;
} }
.single-post-thumbnail img { .single-post-thumbnail img {
max-width: 100%; width: 100%;
height: auto; height: auto;
aspect-ratio: 21 / 9; /* Cinematic ultra-wide for detail view */
object-fit: cover;
border-bottom: 1px solid var(--wp--preset--color--border);
}
/* --- Content Images & Captions --- */
.entry-content img {
height: auto;
margin-bottom: var(--wp--preset--spacing--30);
border: 1px solid var(--wp--preset--color--border);
padding: 5px;
background: #FFFFFF;
}
.wp-block-image {
margin-bottom: var(--wp--preset--spacing--50);
}
figcaption {
font-size: 13px;
text-align: center;
color: var(--wp--preset--color--accent);
font-style: italic;
margin-top: 10px;
font-family: var(--wp--preset--font-family--body-font);
}
/* Alignments */
.alignwide {
margin-left: -10%;
margin-right: -10%;
max-width: 120%;
}
.alignfull {
margin-left: calc(50% - 50vw);
margin-right: calc(50% - 50vw);
width: 100vw;
max-width: 100vw;
}
@media (max-width: 768px) {
.alignwide, .alignfull {
margin-left: 0;
margin-right: 0;
width: 100%;
}
} }
.entry-date { .entry-date {
margin-left: 10px; margin-left: 10px;
opacity: 0.5; opacity: 0.5;
font-size: 14px; font-size: 12px;
text-transform: uppercase; text-transform: uppercase;
} }
.post-navigation { .post-navigation {
border-top: 1px solid var(--wp--preset--color--border); border-top: 1px solid var(--wp--preset--color--border);
margin-top: var(--wp--preset--spacing--90); margin-top: var(--wp--preset--spacing--90);
padding: var(--wp--preset--spacing--70) 0; padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
} }
.nav-links { .nav-links {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
gap: 20px;
flex-wrap: wrap;
}
.nav-links div {
flex: 1;
min-width: 200px;
} }
.nav-links a { .nav-links a {
@@ -274,7 +373,7 @@ body {
.newsletter-strip { .newsletter-strip {
background-color: var(--wp--preset--color--primary); background-color: var(--wp--preset--color--primary);
color: white; color: white;
padding: var(--wp--preset--spacing--70) 0; padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
} }
.newsletter-content { .newsletter-content {
@@ -289,7 +388,7 @@ body {
.newsletter-text { .newsletter-text {
font-family: var(--wp--preset--font-family--header-font); font-family: var(--wp--preset--font-family--header-font);
font-size: 24px; font-size: clamp(1.25rem, 4vw, 24px);
} }
.newsletter-form { .newsletter-form {
@@ -306,6 +405,8 @@ body {
color: white; color: white;
flex-grow: 1; flex-grow: 1;
padding: 10px; padding: 10px;
font-size: 16px;
min-width: 0;
} }
.newsletter-submit { .newsletter-submit {
@@ -313,37 +414,60 @@ body {
border: none; border: none;
color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent);
cursor: pointer; cursor: pointer;
flex-shrink: 0;
} }
/* --- 8. Footer --- */ /* --- 8. Footer --- */
.site-footer { .site-footer {
padding: var(--wp--preset--spacing--50) 0; padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--50);
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
background-color: var(--wp--preset--color--base); background-color: var(--wp--preset--color--base);
} }
/* --- 9. Responsive --- */ /* --- 9. Additional Responsiveness --- */
@media (max-width: 900px) { @media (max-width: 768px) {
.insights-grid { grid-template-columns: repeat(2, 1fr); } .header-container {
flex-direction: column;
gap: 20px;
}
.main-navigation ul {
gap: 20px;
}
.site-container {
padding: 0 var(--wp--preset--spacing--30);
}
} }
@media (max-width: 600px) { @media (max-width: 480px) {
.insights-grid { grid-template-columns: 1fr; } .insights-grid {
.hero-headline { font-size: 32px; } grid-template-columns: 1fr;
.header-container { flex-direction: column; gap: 20px; } }
.cta-button {
width: 100%;
text-align: center;
}
.comment-meta {
flex-direction: column;
align-items: flex-start;
gap: 5px;
}
} }
/* --- 10. Comments Section --- */ /* --- 10. Comments Section --- */
.comments-area { .comments-area {
margin-top: var(--wp--preset--spacing--90); margin-top: var(--wp--preset--spacing--90);
border-top: 1px solid var(--wp--preset--color--border); border-top: 1px solid var(--wp--preset--color--border);
padding-top: var(--wp--preset--spacing--70); padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
} }
.comments-title, .comment-reply-title { .comments-title, .comment-reply-title {
font-family: var(--wp--preset--font-family--header-font); font-family: var(--wp--preset--font-family--header-font);
font-size: 32px; font-size: clamp(1.5rem, 5vw, 32px);
margin-bottom: var(--wp--preset--spacing--50); margin-bottom: var(--wp--preset--spacing--50);
} }
@@ -376,7 +500,7 @@ body {
} }
.comment-metadata { .comment-metadata {
font-size: 12px; font-size: 11px;
opacity: 0.5; opacity: 0.5;
text-transform: uppercase; text-transform: uppercase;
} }
@@ -416,10 +540,11 @@ body {
#commentform input[type="email"], #commentform input[type="email"],
#commentform textarea { #commentform textarea {
width: 100%; width: 100%;
padding: 10px; padding: 12px;
border: 1px solid var(--wp--preset--color--border); border: 1px solid var(--wp--preset--color--border);
background: #FFFFFF; background: #FFFFFF;
font-family: var(--wp--preset--font-family--body-font); font-family: var(--wp--preset--font-family--body-font);
font-size: 16px;
} }
#commentform textarea { #commentform textarea {
@@ -438,6 +563,12 @@ body {
transition: background 0.3s ease; transition: background 0.3s ease;
} }
@media (max-width: 480px) {
#commentform .submit {
width: 100%;
}
}
#commentform .submit:hover { #commentform .submit:hover {
background-color: var(--wp--preset--color--accent); background-color: var(--wp--preset--color--accent);
} }