✨feature: Build interior layout
This commit is contained in:
+40
-35
@@ -143,14 +143,17 @@ class Breadcrumbs {
|
||||
private static function getCustomPostTypeBreadcrumbs() {
|
||||
$breadcrumbs = array();
|
||||
$postType = get_post_type_object( get_post_type() );
|
||||
if ( $postType && ! in_array( get_post_type(), array( 'post', 'page' ), true ) ) {
|
||||
|
||||
if ( $postType && ! in_array( get_post_type(), array( 'post', 'page' ), true ) ) {
|
||||
$breadcrumbs[] = array(
|
||||
'url' => get_post_type_archive_link( $postType->name ),
|
||||
'label' => $postType->labels->name,
|
||||
);
|
||||
}
|
||||
$breadcrumbs[] = array( 'label' => get_the_title() );
|
||||
return $breadcrumbs;
|
||||
|
||||
$breadcrumbs[] = array( 'label' => get_the_title() );
|
||||
|
||||
return $breadcrumbs;
|
||||
}
|
||||
|
||||
/** Generates breadcrumbs for a static page.
|
||||
@@ -165,17 +168,21 @@ class Breadcrumbs {
|
||||
*/
|
||||
private static function getStaticPageBreadcrumbs( $post ) {
|
||||
$breadcrumbs = array();
|
||||
if ( $post->post_parent ) {
|
||||
|
||||
if ( $post->post_parent ) {
|
||||
$ancestors = array_reverse( get_post_ancestors( $post->ID ) );
|
||||
foreach ( $ancestors as $ancestor ) {
|
||||
|
||||
foreach ( $ancestors as $ancestor ) {
|
||||
$breadcrumbs[] = array(
|
||||
'url' => get_permalink( $ancestor ),
|
||||
'label' => get_the_title( $ancestor ),
|
||||
);
|
||||
}
|
||||
}
|
||||
$breadcrumbs[] = array( 'label' => get_the_title() );
|
||||
return $breadcrumbs;
|
||||
|
||||
$breadcrumbs[] = array( 'label' => get_the_title() );
|
||||
|
||||
return $breadcrumbs;
|
||||
}
|
||||
|
||||
/** Generates a breadcrumb for taxonomy archive pages.
|
||||
@@ -257,7 +264,8 @@ class Breadcrumbs {
|
||||
*/
|
||||
private static function getAuthorArchiveBreadcrumb() {
|
||||
$author = get_queried_object();
|
||||
return array( 'label' => 'Author: ' . $author->display_name );
|
||||
|
||||
return array( 'label' => 'Author: ' . $author->display_name );
|
||||
}
|
||||
|
||||
/** Generates the breadcrumb for search results.
|
||||
@@ -314,35 +322,32 @@ class Breadcrumbs {
|
||||
$isActive = ( $index === count( $items ) - 1 );
|
||||
$activeClass = $isActive ? ' active' : '';
|
||||
?>
|
||||
<span class="p-2 breadcrumb-item<?php echo esc_attr( $activeClass ); ?>"
|
||||
<?php
|
||||
if ( $isActive ) :
|
||||
?>
|
||||
aria-current="page"<?php endif; ?>>
|
||||
<?php if ( ! empty( $item['url'] ) ) : ?>
|
||||
<a href="<?php echo esc_url( $item['url'] ); ?>">
|
||||
<?php if ( $index === 0 ) : ?>
|
||||
<svg class="flex-shrink-0 w-5 h-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" aria-label="Home">
|
||||
<path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z" />
|
||||
</svg>
|
||||
<span class="sr-only"><?php echo esc_attr( $item['label'] ); ?></span>
|
||||
<?php else : ?>
|
||||
<?php echo esc_attr( $item['label'] ); ?>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php $ldItem['item'] = $item['url']; ?>
|
||||
<?php else : ?>
|
||||
<?php echo esc_attr( $item['label'] ); ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<span class="p-2 breadcrumb-item<?php echo esc_attr( $activeClass ); ?>"
|
||||
<?php if ( $isActive ) : ?>
|
||||
aria-current="page"
|
||||
<?php endif; ?>>
|
||||
|
||||
<?php $metadata['itemListElement'][] = $ldItem; ?>
|
||||
<?php if ( ! empty( $item['url'] ) ) : ?>
|
||||
<a href="<?php echo esc_url( $item['url'] ); ?>">
|
||||
<?php if ( $index === 0 ) : ?>
|
||||
<?php echo esc_attr( $item['label'] ); ?>
|
||||
<?php else : ?>
|
||||
<?php echo esc_attr( $item['label'] ); ?>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php $ldItem['item'] = $item['url']; ?>
|
||||
<?php else : ?>
|
||||
<?php echo esc_attr( $item['label'] ); ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
|
||||
<?php if ( ! $isActive ) : ?>
|
||||
<svg class="flex-shrink-0 w-5 h-5 text-light" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
<?php endif; ?>
|
||||
<?php $metadata['itemListElement'][] = $ldItem; ?>
|
||||
|
||||
<?php if ( ! $isActive ) : ?>
|
||||
<svg class="flex-shrink-0 w-5 h-5 text-light" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</nav>
|
||||
|
||||
|
||||
Vendored
+2249
-3299
File diff suppressed because it is too large
Load Diff
+15
-12
@@ -2,10 +2,10 @@
|
||||
* Scoped to .page-hero to avoid affecting the homepage-hero block. */
|
||||
|
||||
.page-hero {
|
||||
background: linear-gradient(83.68deg, #032F46 3.13%, #006196 45.91%, #8FC9E6 96.27%);
|
||||
background: linear-gradient(73.83deg, #8FC9E6 -8.7%, #006196 21.51%, #032F46 60.7%);
|
||||
isolation: isolate;
|
||||
margin-bottom: 10rem;
|
||||
min-height: clamp(31rem, 38vw, 36rem);
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -16,19 +16,22 @@
|
||||
}
|
||||
|
||||
.page-hero__heading {
|
||||
color: var(--color-light, #fff);
|
||||
font-family: var(--font-quincy, 'Quincy', serif);
|
||||
font-weight: 400;
|
||||
font-size: clamp(2.5rem, 6vw, 4.5rem);
|
||||
line-height: 1.05;
|
||||
margin-block: clamp(1.5rem, 4vw, 3rem) 0;
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
margin: 3rem 0 1.5rem;
|
||||
max-width: 36rem;
|
||||
text-align: left;
|
||||
|
||||
em {
|
||||
color: var(--color-secondary);
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.page-hero__intro {
|
||||
color: var(--color-light, #fff);
|
||||
color: #fff;
|
||||
font-size: clamp(1rem, 1.5vw, 1.25rem);
|
||||
font-weight: 300;
|
||||
line-height: 1.5;
|
||||
max-width: 36rem;
|
||||
opacity: 0.95;
|
||||
@@ -36,13 +39,13 @@
|
||||
}
|
||||
|
||||
.page-hero__media {
|
||||
bottom: -8%;
|
||||
bottom: -5%;
|
||||
height: auto;
|
||||
max-height: none;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
right: clamp(0.5rem, 2vw, 2rem);
|
||||
top: clamp(2rem, 4vw, 4rem);
|
||||
right: 23vw;
|
||||
top: 3rem;
|
||||
width: auto;
|
||||
z-index: 1;
|
||||
/* Set width via max-width so the image's natural aspect ratio is preserved. */
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
/* Hover state: triggered by li so it persists when moving into the submenu.
|
||||
Also triggered when a submenu is open (e.g. via keyboard/click). */
|
||||
&:hover,
|
||||
&:has(a[aria-current="true"]),
|
||||
&:has(.menu-vdi__toggle[aria-expanded="true"]) {
|
||||
>a,
|
||||
>.menu-vdi__toggle {
|
||||
|
||||
@@ -31,14 +31,13 @@ $wrapperStyle = $bgColor ? 'background-color: ' . esc_attr( $bgColor ) . ';' : '
|
||||
?>
|
||||
|
||||
<div class="page-hero text-light <?php echo $isDark ? 'dark' : ''; ?>" style="<?php echo esc_attr( $wrapperStyle ); ?>">
|
||||
|
||||
<div class="page-hero__content container mx-auto px-0!">
|
||||
<div id="breadcrumbs">
|
||||
<!-- <div id="breadcrumbs">
|
||||
<?php Breadcrumbs::render(); ?>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<h1 class="page-hero__heading">
|
||||
<?php echo wp_kses_post( $heading ); ?>
|
||||
<?php echo wp_kses_post( $heading ); ?><em>.</em>
|
||||
</h1>
|
||||
|
||||
<?php if ( $intro ) : ?>
|
||||
|
||||
Reference in New Issue
Block a user