<?php
/**
 * @package norstar
 */
?>

<div class="item">
	<article id="post-<?php the_ID(); ?>" <?php post_class( 'blog-post' ); ?>>
		<div class="main-post entry-border">
			<?php get_template_part( 'tpl/feature-post'); ?>
			
			<div class="content-post">
				<?php 
				$content_elements = themesflat_layout_draganddrop(themesflat_get_opt( 'post_content_elements' ));
				$post_elements = themesflat_layout_draganddrop(themesflat_get_opt( 'meta_elements' ));

				foreach ( $content_elements as $content_element ) :
					if( 'tag' == $content_element ){
						get_template_part( 'tpl/entry-content/entry-content-tag' );
					} elseif ( 'title' == $content_element ) {
						get_template_part( 'tpl/entry-content/entry-content-title' );
					} elseif ( 'meta' == $content_element ) {
						get_template_part( 'tpl/entry-content/entry-content-meta' );
					} elseif ( 'excerpt_content' == $content_element ) {
						get_template_part( 'tpl/entry-content/entry-content-body' );
					} 
				endforeach;

				if ( in_array('readmore',$content_elements) || in_array('author',$post_elements) ) :
				?>
				<div class="themesflat-button-container">
					<?php							
						if ( in_array('readmore',$content_elements) ) {
							get_template_part( 'tpl/entry-content/entry-content-readmore' );
						}	
					?>
							
				</div>
				<?php endif; ?>
				
			</div><!-- /.entry-post -->
		
		</div><!-- /.main-post -->
	</article><!-- #post-## -->
</div>