<?php 
/**
 * Template part for displaying Featured About Section
 *
 * @package prime_seo_agency
 */

$prime_seo_agency_about = get_theme_mod( 'prime_seo_agency_about_setting',false );
$prime_seo_agency_featured_mission_section_title = get_theme_mod( 'prime_seo_agency_featured_mission_section_title' );
$prime_seo_agency_featured_mission_posts[] = get_theme_mod( 'prime_seo_agency_featured_mission_post_' );

?>
<?php if ( $prime_seo_agency_about ){?>
<div id="about-section" class="section-content py-5">
    <div class="container">        
        <?php $args = array (
            'post_type'     => 'page',
            'posts_per_page' => 1,
            'post__in'      => $prime_seo_agency_featured_mission_posts,
            'orderby'       =>'post__in',
            'ignore_sticky_posts' => true,
        );?>
        <?php
        $loop = new WP_Query($args);
        if ( $loop->have_posts() ) :
            while ($loop->have_posts()) : $loop->the_post(); ?>
            <div class="featured-mission-box">
                <div class="row">                    
                    <div class="col-lg-6 col-md-6 align-self-center side-1">
                        <header class="entry-header">
                            <?php if( !empty($prime_seo_agency_featured_mission_section_title) ): ?>
                                <div class="section-title">
                                    <h3><?php echo esc_html($prime_seo_agency_featured_mission_section_title); ?></h3>
                                </div>
                            <?php endif; ?>
                        </header>
                        <div class="entry-content">
                            <p class="mb-0"><?php echo wp_trim_words( get_the_content(), 100 ); ?></p>
                        </div>

                        <div class="btn-green my-4">
                            <a href="<?php the_permalink(); ?>">
                                <?php esc_html_e('READ MORE','prime-seo-agency'); ?>
                            </a>
                        </div>
                        <img src="<?php echo get_stylesheet_directory_uri() . '/images/aboutsignature.png'; ?>">
                    </div>
                    <div class="col-lg-6 col-md-6 align-self-center about-us wow zoomInUp delay-1000" data-wow-duration="2s">
                        <div class="about-img">
                           <?php
                          if ( has_post_thumbnail() ) :
                            the_post_thumbnail();
                          else:
                            ?>
                            <div class="image-container">
                              <img src="<?php echo get_stylesheet_directory_uri() . '/images/banner.jpg'; ?>">
                            </div>
                            <?php
                          endif;
                        ?>
                        </div>
                    </div>
                </div>
            </div>
        <?php endwhile; ?>
        <?php endif; ?>
        <?php wp_reset_postdata(); ?>
    </div>
</div>
<?php } ?>