Files
CWC/views/partials/page-hero.php
T
Keith Solomon e38511126d
Deploy to Dreamhost (dev) / build (push) Successful in 36s
Sync TODOs with Issues / sync_todos (push) Successful in 6s
🐞 fix: Adjust mobile layout for blog page and add regression tests
2026-07-12 13:19:53 -05:00

58 lines
1.8 KiB
PHP

<?php
/**
* Page Hero Partial
*
* @package CWC
*/
namespace CWC;
// Set variables
$bgColor = get_field( 'background_color' );
$isDark = get_field( 'is_dark' );
$heading = get_field( 'heading' );
$intro = get_field( 'intro' );
if ( is_home() ) {
$intro = get_field( 'intro', get_option( 'page_for_posts' ) );
}
// Fallback for heading
if ( ! $heading ) {
$heading = getTheTitle();
}
$wrapperStyle = $bgColor ? 'background-color: ' . esc_attr( $bgColor ) . ';' : '';
?>
<div class="page-hero <?php echo $isDark ? 'dark' : ''; ?> pt-4 lg:px-0 lg:pt-30 lg:mb-4" style="<?php echo esc_attr( $wrapperStyle ); ?>">
<div class="page-hero__content container flex flex-col lg:flex-row justify-between gap-6 lg:gap-20 mx-auto lg:px-0!">
<!-- <div id="breadcrumbs">
<?php Breadcrumbs::render(); ?>
</div> -->
<?php
if ( ! is_single() ) :
if ( $heading ) :
?>
<h1 class="page-hero__heading flex-0">
<?php echo wp_kses_post( $heading ); ?><em>.</em>
</h1>
<?php endif; ?>
<?php if ( $intro ) : ?>
<div class="page-hero__intro grow text-18px mb-6">
<?php echo wp_kses_post( $intro ); ?>
</div>
<?php
endif;
else :
?>
<a href="<?php echo esc_url( get_permalink( get_option( 'page_for_posts' ) ) ); ?>" class="page-hero__back-link flex items-center gap-2 text-20px font-bold text-cwc-blue-03! hover:text-cwc-blue-01!">
<span class=""><?php get_template_part( 'views/icons/prev', null, array( 'width' => 7, 'height' => 12 ) ); // phpcs:ignore ?></span>
<span>Back</span>
</a>
<?php endif; ?>
</div>
</div>