<?php
/**
 * The template part for displaying the blog section on homepage
 *
 * @package Meridian One
 * @since 1.0
 */
?>
<?php

	$title = false;
	$subtitle = false;
	$button_url = false;
	$button_text = false;

	if ( meridian_one_get_theme_option( 'home_blog_section_title' ) ) {
		$title = meridian_one_get_theme_option( 'home_blog_section_title' );
	}

	if ( meridian_one_get_theme_option( 'home_blog_section_subtitle' ) ) {
		$subtitle = meridian_one_get_theme_option( 'home_blog_section_subtitle' );
	}

	if ( meridian_one_get_theme_option( 'home_blog_section_button_url' ) ) {
		$button_url = meridian_one_get_theme_option( 'home_blog_section_button_url' );
	}

	if ( meridian_one_get_theme_option( 'home_blog_section_button_text' ) ) {
		$button_text = meridian_one_get_theme_option( 'home_blog_section_button_text' );
	}

?>
<div id="news" class="section section-blog">

	<div class="wrapper">

		<div class="section-blog-main clearfix">
			
			<div class="section-blog-info col col-3">
				
				<?php if ( $title ) : ?>
					<h2 class="section-title"><?php echo esc_html( $title ); ?></h2>
				<?php endif; ?>

				<?php if ( $subtitle ) : ?>
					<h3 class="section-subtitle"><?php echo esc_html( $subtitle ); ?></h3>
				<?php endif; ?>

				<?php if ( $button_url && $button_text ) : ?>
					<a href="<?php echo esc_url( $button_url ); ?>" class="section-blog-button"><?php echo esc_html( $button_text ); ?></a>
				<?php endif; ?>

			</div><!-- .section-blog-info -->

			<?php meridian_one_home_section_blog_display_posts(); ?>

		</div><!-- .section-blog-main -->

	</div><!-- .wrapper -->

</div><!-- .section-blog -->