Skip to content

Commit c7e7f13

Browse files
author
Ariel Jolo
committed
trying new layout
1 parent 2475d5f commit c7e7f13

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

themes/osi/template-parts/content-board-member.php

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?php
22
/**
3-
* Template for displaying a board member in a side-by-side layout
4-
* where the left column (header) is sticky and only the right column scrolls.
3+
* Template for displaying a board member in a side-by-side layout:
4+
* Left column (header) is 30% wide and sticky; right column is 70% wide.
55
*
66
* @package osi
77
*/
88
?>
99
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
1010
<div class="board-member-wrapper">
1111

12-
<!-- Left Column: Sticky CPT Header -->
12+
<!-- LEFT COLUMN: Sticky CPT Header (30% width) -->
1313
<div class="board-member-header">
1414
<?php get_template_part( 'template-parts/header-board-member' ); ?>
1515
</div>
1616

17-
<!-- Right Column: Scrollable Content -->
17+
<!-- RIGHT COLUMN: Main Content (70% width, scrolls normally) -->
1818
<div class="board-member-content">
1919
<div class="entry-content post--content">
2020
<?php the_content(); ?>
@@ -24,37 +24,34 @@
2424
<?php // get_template_part( 'template-parts/nav-postname-pager' ); ?>
2525
<?php // get_template_part( 'template-parts/email-block' ); ?>
2626
</section>
27-
</div>
27+
</div><!-- .board-member-content -->
2828
</div><!-- .board-member-wrapper -->
2929
</article>
3030

3131
<style>
3232
/*
33-
1) We make a flex container for the two columns.
34-
2) The left column is "sticky" so it stays pinned below the site header.
35-
3) The right column scrolls normally.
33+
The container for both columns:
34+
- We use flex to lay out the left and right columns.
35+
- We leave some gap if needed.
3636
*/
37-
3837
.board-member-wrapper {
3938
display: flex;
40-
align-items: flex-start; /* So columns top-align */
41-
gap: 20px; /* optional spacing between columns */
39+
align-items: flex-start; /* So columns align at the top */
40+
gap: 0; /* adjust as desired */
4241
}
4342

44-
/* LEFT COLUMN: Sticky */
43+
/* LEFT COLUMN: 30% width, sticky under the site header */
4544
.board-member-header {
46-
position: sticky;
47-
top: 120px; /* adjust to your site header’s height */
48-
flex-shrink: 0; /* so it doesn’t shrink */
49-
width: 350px; /* pick any suitable width */
50-
background-color: #fff;
51-
padding: 20px;
45+
position: sticky;
46+
top: 120px; /* match this to your site header height so there's no overlap */
47+
width: 30%;
48+
flex-shrink: 0; /* prevents the left column from shrinking */
5249
box-sizing: border-box;
5350
}
5451

55-
/* RIGHT COLUMN: Normal Flow, Fills Remaining Space */
52+
/* RIGHT COLUMN: 70% width, scrolls normally */
5653
.board-member-content {
57-
flex: 1;
54+
width: 70%;
5855
padding: 20px;
5956
box-sizing: border-box;
6057
}

themes/osi/template-parts/header-board-member.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22
/**
3-
* Template part for displaying board member header details.
3+
* Template part for displaying board member header details in a single column.
44
*
55
* @package osi
66
*/
77
?>
88
<header class="entry-header cover--header no-thumbnail">
9-
<div class="wp-block-cover alignfull has-neutral-dark-background-color has-background-dim-100 has-background-dim">
9+
<!-- Removed alignfull to prevent forced full width -->
10+
<div class="wp-block-cover has-neutral-dark-background-color has-background-dim-100 has-background-dim">
1011
<div class="wp-block-cover__inner-container">
1112
<!-- SINGLE COLUMN for CPT Header Elements -->
1213
<div class="cpt-header-single-column">
@@ -69,7 +70,7 @@
6970
</header>
7071

7172
<style>
72-
/* Keep these existing styles: */
73+
/* Keep existing styles: */
7374
.member-image {
7475
margin-bottom: 1.5rem;
7576
}
@@ -91,8 +92,7 @@
9192
font-family: 'Space Mono', monospace;
9293
display: inline-block;
9394
}
94-
95-
/* Ensure each element in the header stacks vertically */
95+
/* Stack each element in the header vertically */
9696
.cpt-header-single-column > * {
9797
display: block;
9898
margin-bottom: 1rem;

0 commit comments

Comments
 (0)