<?php
/**
* Front About Section
*
* @package constructionn
*/
$toggle_front_about = get_theme_mod( 'toggle_front_about', false );
$about_subheading = get_theme_mod( 'about_subheading' );
$about_headings = get_theme_mod( 'about_headings' );
$about_descriptions = get_theme_mod( 'about_descriptions' );
$notice_headings = get_theme_mod( 'notice_headings' );
$notice_descriptions = get_theme_mod( 'notice_descriptions' );
$about_btn_txt = get_theme_mod( 'about_btn_txt' );
$about_btn_link = get_theme_mod( 'about_btn_link' );
$front_about_repeaters = get_theme_mod( 'front_about_repeaters' );
$about_image_one = get_theme_mod( 'about_image_one' );
$about_image_two = get_theme_mod( 'about_image_two' );
$image_id_one = attachment_url_to_postid( $about_image_one );
$image_id_two = attachment_url_to_postid( $about_image_two );
if ( $toggle_front_about && ( ( $about_image_one || $image_id_one ) || ( $about_image_two || $image_id_two ) || $about_subheading || $about_headings || $about_descriptions || $notice_headings || $notice_descriptions || ( $about_btn_txt && $about_btn_link ) || $front_about_repeaters ) ) { ?>
<div id="front-about" class="about-section front-about">
<div class="container">
<div class="about-section-wrapper">
<?php if ( $about_headings ) { ?>
<div class="about-top">
<?php if ( $about_headings ) { ?>
<div class="section-meta-wrap is-centered">
<h2 class="section-heading"><?php echo esc_html( $about_headings ); ?></h2>
</div>
<?php } ?>
</div>
<?php } ?>
<div class="about-bottom">
<?php if ( ( $about_image_one || $image_id_one ) || ( $about_image_two || $image_id_two ) || $notice_headings || $notice_descriptions ) { ?>
<div class="about-left">
<?php if ( ( $about_image_one || $image_id_one ) || ( $about_image_two || $image_id_two ) ) { ?>
<div class="img-wrapper">
<?php
if ( $image_id_one ) {
echo wp_get_attachment_image( $image_id_one, 'about_img_one' );
} if ( $image_id_two ) {
echo wp_get_attachment_image( $image_id_two, 'about_img_two' );
}
?>
</div>
<?php } if ( $notice_headings || $notice_descriptions ) { ?>
<div class="text-wrapper">
<?php if ( $notice_headings ) { ?>
<h5 class="title"><?php echo esc_html( $notice_headings ); ?></h5>
<?php } if ( $notice_descriptions ) { ?>
<p><?php echo esc_html( $notice_descriptions ); ?></p>
<?php } ?>
</div>
<?php } ?>
</div>
<?php } if ( $about_subheading || $about_descriptions || $front_about_repeaters || ( $about_btn_txt && $about_btn_link ) ) { ?>
<div class="about-right">
<?php if ( $about_subheading || $about_descriptions ) { ?>
<div class="right-top">
<?php if ( $about_subheading ) { ?>
<h4 class="title"><?php echo esc_html( $about_subheading ); ?></h4>
<?php } if ( $about_descriptions ) { ?>
<?php echo wpautop( esc_html( $about_descriptions ) ); ?>
<?php } ?>
</div>
<?php } ?>
<div class="features-wrap">
<?php
foreach ( $front_about_repeaters as $abtrepeater ) {
$text = ( ! empty( $abtrepeater['text'] ) && isset( $abtrepeater['text'] ) ) ? $abtrepeater['text'] : '';
$description = ( ! empty( $abtrepeater['description'] ) && isset( $abtrepeater['description'] ) ) ? $abtrepeater['description'] : '';
if ( $text || $description ) {
?>
<div class="feature">
<?php if ( $text ) { ?>
<h5 class="title"><?php echo esc_html( $text ); ?></h5>
<?php } if ( $description ) { ?>
<?php echo wpautop( esc_html( $description ) ); ?>
<?php } ?>
</div>
<?php
}
}
?>
</div>
<?php if ( $about_btn_txt && $about_btn_link ) { ?>
<a href="<?php echo esc_url( $about_btn_link ); ?>" class="btn has-icon btn__primary"><?php echo esc_html( $about_btn_txt ); ?></a>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<?php
}