<?php

/**
 * Who we are Section
 * 
 * @package relax_spa
 */

if (get_theme_mod('bs_who_we_are_display_option', true)) :
  $who_we_are_title       = get_theme_mod('bs_heading_for_who_we_are');
  $bs_button_name       = get_theme_mod('bs_button_name', esc_html__( 'Learn More', 'relax-spa' ) );
  $whoPage = get_page_by_path(get_theme_mod('bs_who_we_are_pages'));

  $post = get_post($whoPage);
  setup_postdata($post);

  if ($who_we_are_title or !empty($whoPage)) {
    $img_url = get_theme_mod( 'rs_who_we_are_image', get_template_directory_uri() . '/images/testimonial.webp' );
  }
?>
  <section class="home-section about" style="background-image: url(<?php echo esc_url($img_url); ?>);" id="relax_spa_who_we_are_section">
    <div class="container">
      <?php if ($who_we_are_title or !empty($whoPage)) { ?>
        <div class="about-holder">
          <h2 class="main-title"><?php echo esc_html($who_we_are_title); ?></h2>

          <?php
          if ($whoPage) {
          ?>
            <?php the_excerpt(); ?>
            <?php if ($bs_button_name) { ?>
            <a href="<?php the_permalink(); ?>" class="btn btn-third"><?php echo esc_html($bs_button_name); ?></a>
            <?php } ?>
          <?php } ?>

        </div>
      <?php } ?>

    </div>
  </section>
<?php

  wp_reset_postdata();
endif;
