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

$downloads_id = get_theme_mod( 'oginer_downloads_id', 'downloads' );
$downloads_page = get_theme_mod( 'oginer_downloads_page' );

?>
	<section id="<?php echo esc_attr( $downloads_id ); ?>" class="mw-section downloads bg-dark">
		<div class="container">
			<?php if ( $downloads_page ) { ?>
				<div class="row">
					<div class="section-title-box col-md-10 col-md-offset-1 text-center">
						<?php
							$args = array(
								'page_id' => absint( $downloads_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(); ?>
								
									<h2 class="section-title"><?php the_title(); ?></h2>
									
									<p><?php the_content(); ?></p>
									
									<?php  
								endwhile;
								
								wp_reset_postdata();
								
							endif; 
						?>
					</div>
				</div>
				<?php
			}
			?>
			<div class="row">
				<div class="col-md-10 col-md-offset-1 text-center">
					<div class="download-links mw-animation" data-os-animation="lightSpeedIn">
						<?php dynamic_sidebar( 'home-button-link' ); ?>
					</div>
				</div>
			</div>
		</div>
	</section>
