<?php
/**
 * The template for displaying about section
 *
 * @package Oginer
 */

$about_id = get_theme_mod( 'oginer_about_id', 'about-us' );
$about_page = get_theme_mod( 'oginer_about_page' );
$about_url = get_theme_mod( 'oginer_about_url', '#' );
$about_url_title = get_theme_mod( 'oginer_about_url_title', __( 'read more', 'oginer' ) );

if ( $about_page ) { ?>
	<section id="<?php echo esc_attr( $about_id ); ?>" class="mw-section bg-1 mw-animation" data-os-animation="fadeInUp" data-os-animation-delay="0.7s">
		<div class="container">
			<div class="row">
				<?php
					$args = array(
						'page_id' => absint( $about_page ),
						'post_status' => 'publish'
					);

					$post_query = new WP_Query( $args );
					
					if( $post_query->have_posts() ): ?>
						<?php while ( $post_query->have_posts() ) : $post_query->the_post(); ?>
							<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
								<div class="section-content">
									<h2 class="section-title"><?php the_title(); ?></h2>
									<?php the_content(); ?>
									<?php if ( $about_url != '' ) { ?>
									<div class="button-box">
										<a href="<?php echo esc_url( $about_url ); ?>" class="btn"><?php echo esc_html( $about_url_title ); ?></a>
									</div>
									<?php } ?>
								</div>
							</div>
							<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
								<?php if ( has_post_thumbnail() ) : ?>
						
									<div class="featured-media">
							
										<?php the_post_thumbnail( 'full' ); ?>
										
									</div><!-- .featured-media -->
										
								<?php endif; ?>
							</div>
							<?php 
						endwhile;
						wp_reset_postdata();
					endif; 
				?>
			</div>
		</div>
	</section>
<?php }