🐞 fix: Update Calls to Action field label and name, adjust layout settings, and enhance page hero services structure
This commit is contained in:
@@ -14,23 +14,19 @@ $heading = get_field( 'heading' );
|
||||
$heroImage = get_field( 'hero_image' );
|
||||
$heroVector = get_field( 'hero_vector' );
|
||||
$intro = get_field( 'intro' );
|
||||
$ctas = get_field( 'ctas' );
|
||||
|
||||
// Fallback for heading
|
||||
if ( ! $heading ) {
|
||||
$heading = getTheTitle();
|
||||
}
|
||||
|
||||
// Additional logic for dark mode (if needed)
|
||||
if ( is_home() || is_single() || is_archive() || is_search() || is_404() ) {
|
||||
$isDark = true;
|
||||
}
|
||||
|
||||
// The wrapper color is the gradient from .page-hero in page-hero.css. The
|
||||
// editor's background_color ACF field overrides the gradient with a solid color.
|
||||
$wrapperStyle = $bgColor ? 'background-color: ' . esc_attr( $bgColor ) . ';' : '';
|
||||
?>
|
||||
|
||||
<div class="page-hero-services text-light <?php echo $isDark ? 'dark' : ''; ?>" style="<?php echo esc_attr( $wrapperStyle ); ?>">
|
||||
<div class="page-hero-services text-light" <?php if ( $wrapperStyle ) { // phpcs:ignore ?>style="<?php echo esc_attr( $wrapperStyle ); ?>"<?php } ?>>
|
||||
<div class="page-hero-services__content container mx-auto px-0!">
|
||||
<!-- <div id="breadcrumbs">
|
||||
<?php Breadcrumbs::render(); ?>
|
||||
@@ -45,6 +41,31 @@ $wrapperStyle = $bgColor ? 'background-color: ' . esc_attr( $bgColor ) . ';' : '
|
||||
<?php echo wp_kses_post( $intro ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $ctas ) : ?>
|
||||
<div class="reset mt-4 sm:mt-6 flex flex-wrap justify-center lg:justify-start gap-4">
|
||||
<?php foreach ( $ctas as $index => $cta ) : ?>
|
||||
<?php
|
||||
$ctaLink = $cta['link'];
|
||||
$ctaURL = $ctaLink['url'] ?? '#';
|
||||
$ctaTarget = $ctaLink['target'] ?? '_self';
|
||||
$ctaTitle = $ctaLink['title'] ?? '';
|
||||
?>
|
||||
|
||||
<x-button
|
||||
btnclasses="button text-center min-w-32 dark"
|
||||
element="a"
|
||||
url="<?php echo esc_url( $ctaURL ); ?>"
|
||||
target="<?php echo esc_attr( $ctaTarget ); ?>"
|
||||
title="<?php echo esc_attr( $ctaTitle ); ?>"
|
||||
color="primary"
|
||||
<?php if ( $index !== 0 ) { ?>
|
||||
variant="outline"
|
||||
<?php } ?>
|
||||
></x-button>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $heroImage ) : ?>
|
||||
|
||||
Reference in New Issue
Block a user