<?php
/**
 * Template part for displaying about section
 *
 * @package Videographer Studio
 * @subpackage videographer_studio
 */

?>

<?php $videographer_studio_static_image = get_stylesheet_directory_uri() . '/assets/images/about.png'; ?>

<?php if(get_theme_mod('videographer_studio_about_show_hide', true) != ''){ ?>
<section id="about">
  <div class="container">
    <div class="row">
      <?php $videographer_studio_about_page = array();
        $videographer_studio_mod = absint( get_theme_mod( 'videographer_studio_about_page' ));
        if ( 'page-none-selected' != $videographer_studio_mod ) {
          $videographer_studio_about_page[] = $videographer_studio_mod;
        }
      if( !empty($videographer_studio_about_page) ) :
        $videographer_studio_args = array(
          'post_type' => 'page',
          'post__in' => $videographer_studio_about_page,
          'orderby' => 'post__in'
        );
        $videographer_studio_query = new WP_Query( $videographer_studio_args );
        if ( $videographer_studio_query->have_posts() ) :
          while ( $videographer_studio_query->have_posts() ) : $videographer_studio_query->the_post(); ?>
            <div class="col-lg-7 col-md-7 align-self-center">
              <?php if(has_post_thumbnail()){ ?>
             <img src="<?php the_post_thumbnail_url('full'); ?>"/>
              <?php }else {echo ('<img src="'.$videographer_studio_static_image.'">'); } ?>
            </div>
            <div class="col-lg-5 col-md-5 align-self-center">
              <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
              <p><?php echo wp_trim_words( get_the_content(),50 );?></p>
              <div class="more-btn mt-4">
                <a href="<?php the_permalink(); ?>"><?php esc_html_e('Info More','videographer-studio'); ?></a>
                <?php if( get_theme_mod( 'videographer_studio_about_button_1_link' ) != '' || get_theme_mod( 'videographer_studio_about_button_1' ) != '') { ?>
                  <span><i class="fas fa-download"></i><a href="<?php echo esc_url( get_theme_mod( 'videographer_studio_about_button_1_link','' ) ); ?>" class="more-btnn"><?php echo esc_html( get_theme_mod( 'videographer_studio_about_button_1','' ) ); ?></a></span>                  
                <?php } ?>
                </a>
              </div>
            </div>
          <?php endwhile; ?>
        <?php else : ?>
          <div class="no-postfound"></div>
        <?php endif;
      endif;
      wp_reset_postdata()?>
      <div class="clearfix"></div>
    </div>
  </div>
</section>
<?php } ?>

