Render hero_image and hero_vector in page-hero partial; drop in-hero intro
This commit is contained in:
@@ -8,10 +8,11 @@
|
|||||||
namespace CWC;
|
namespace CWC;
|
||||||
|
|
||||||
// Set variables
|
// Set variables
|
||||||
$bgColor = get_field( 'background_color' );
|
$bgColor = get_field( 'background_color' );
|
||||||
$isDark = get_field( 'is_dark' );
|
$isDark = get_field( 'is_dark' );
|
||||||
$heading = get_field( 'heading' );
|
$heading = get_field( 'heading' );
|
||||||
$intro = get_field( 'intro' );
|
$heroImage = get_field( 'hero_image' );
|
||||||
|
$heroVector = get_field( 'hero_vector' );
|
||||||
|
|
||||||
// Fallback for heading
|
// Fallback for heading
|
||||||
if ( ! $heading ) {
|
if ( ! $heading ) {
|
||||||
@@ -24,9 +25,31 @@ if ( is_home() || is_single() || is_archive() || is_search() || is_404() ) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="bg-cover bg-no-repeat mb-12 py-12 lg:py-16 bg-dark text-light overflow-hidden <?php echo $isDark ? 'dark' : ''; ?>" <?php echo $bgColor ? 'style="background-color: ' . esc_attr( $bgColor ) . '"' : ''; ?>>
|
<div class="page-hero bg-cover bg-no-repeat mb-12 py-12 lg:py-16 bg-dark text-light overflow-hidden <?php echo $isDark ? 'dark' : ''; ?>" <?php echo $bgColor ? 'style="background-color: ' . esc_attr( $bgColor ) . '"' : ''; ?>>
|
||||||
|
|
||||||
<div class="container mx-auto">
|
<?php if ( $heroImage ) : ?>
|
||||||
|
<div class="page-hero__media" aria-hidden="true">
|
||||||
|
<img
|
||||||
|
src="<?php echo esc_url( $heroImage['url'] ); ?>"
|
||||||
|
alt=""
|
||||||
|
loading="lazy"
|
||||||
|
role="presentation"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ( $heroVector ) : ?>
|
||||||
|
<img
|
||||||
|
class="page-hero__vector"
|
||||||
|
src="<?php echo esc_url( $heroVector['url'] ); ?>"
|
||||||
|
alt=""
|
||||||
|
loading="lazy"
|
||||||
|
aria-hidden="true"
|
||||||
|
role="presentation"
|
||||||
|
/>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="page-hero__content container mx-auto">
|
||||||
<div id="breadcrumbs">
|
<div id="breadcrumbs">
|
||||||
<?php Breadcrumbs::render(); ?>
|
<?php Breadcrumbs::render(); ?>
|
||||||
</div>
|
</div>
|
||||||
@@ -43,13 +66,6 @@ if ( is_home() || is_single() || is_archive() || is_search() || is_404() ) {
|
|||||||
echo wp_kses_post( $heading );
|
echo wp_kses_post( $heading );
|
||||||
echo '</span>';
|
echo '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Intro
|
|
||||||
if ( $intro ) {
|
|
||||||
echo '<p class="mt-3 text-base text-light sm:mt-5 sm:text-xl lg:text-lg xl:text-xl text-center">';
|
|
||||||
echo wp_kses_post( $intro );
|
|
||||||
echo '</p>';
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user