<?php
/**
 * Posts Layout - layout default
 *
 * @package Blocks
 */
$featured = blocks()->featured_layouts;
?>
<div class="<?php $featured->get_post_container_class(); ?> clear ">

	<div class="container">

		<div class="<?php blocks_article_class(); ?>">

			<div id="content_box">

				<?php blocks_action( 'start_content_box' ); ?>

				<?php $featured->get_section_title(); ?>

				<?php
				if ( ! is_paged() && blocks_get_settings( 'post_button_' . $featured->current['unique_id'] ) ) {
					$category_id = get_cat_ID( $category_name );
					printf( '<div class="viewMore"><a href="%1$s" title="%2$s">%3$s %4$s</a></div>', esc_url( get_category_link( $category_id ) ), esc_attr( $category_name ), __( 'View More', 'blocks' ), '<i class="fa fa-chevron-right"></i>' );
				}
				?>

				<section id="latest-posts" class="layout-<?php echo esc_attr( $featured->current['layout'] ); ?> clearfix">
					<?php
					while ( have_posts() ) :
						the_post();
						?>
					<article class="latestPost excerpt">

						<?php $featured->get_post_thumbnail(); ?>

							<div class="wrapper">

								<?php
								if ( blocks_get_settings( 'home_category_' . $featured->current['unique_id'] ) ) :
									printf( '<div class="thecategory">%s</div>', blocks_get_the_category( ' ' ) );
								endif;
								?>

								<?php $featured->get_post_title( false ); ?>

								<?php $featured->get_post_content( true ); ?>

							</div>

						</article>
						<?php
						endwhile;

						$featured->get_post_pagination();
					?>

				</section><!--#latest-posts-->

			</div>

		</div>

		<?php
		if ( ! is_paged() ) {
			$featured->get_sidebar();
		} else {
			get_sidebar();
		}
		?>

</div>

</div>
