<?php if (have_posts()): while (have_posts()): the_post();
	static $qc = 0;
	$qc++;
?>


		<article id="post-<?php the_ID();?>" <?php post_class();?>>

			<!-- post thumbnail -->
			<?php if (has_post_thumbnail()): // Check if thumbnail exists ?>
				<a class="thumbnailwrapper" href="<?php the_permalink();?>" title="<?php the_title();?>">
					<?php if(is_home() and $qc < 3): ; //first two posts are big
							the_post_thumbnail('home-big-thumbnail');
						else:
							the_post_thumbnail('home-square-thumbnail');
						endif;?>
				</a>
				<?php endif;?>
			<!-- /post thumbnail -->

			<div class="metadata">
				<div class="categories">
					<?php the_category(' | ');?>
					<?php
						$terms = get_the_terms($post->ID, 'Format');
						if ($terms) {
							foreach ($terms as $term) {
								echo '| ';
								echo $term->name;
							}
						}?>
				</div>
				<?php if(is_home() and $qc < 3): ; //first two posts subtitle and excerpt ?>
						<div class="alcim">
							<?php
								$dis_alcim_value = get_post_meta( get_the_ID(), 'dis-alcim', true );
								// Check if the custom field has a value.
								if ( ! empty( $dis_alcim_value ) ) {
    								echo $dis_alcim_value;
								}
							?>
						</div>
						<?php endif;?>
				<div class="vr"></div>
				<div class="postedon">
					<?php the_time('m. d.');?>
				</div>
				<?php if(is_home() and $qc < 3): ; //first two posts subtitle and excerpt ?>
						<div class="bevezeto">
						<?php
								$dis_bevezeto_value = get_post_meta( get_the_ID(), 'dis-bevezeto', true );
								// Check if the custom field has a value.
								if ( ! empty( $dis_bevezeto_value ) ) {
    								echo $dis_bevezeto_value;
								}
							?>
						</div>
						
						<?php endif;?>
						<div class="filler"></div>
			</div> <!-- metadata end -->


			<!-- post title -->
			<h2>
				<a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title();?></a>
			</h2>
			<!-- /post title -->



		</article>


		<?php endwhile;?>

	<?php else: ?>

<!-- article -->
<article>
	<h2><?php _e('Sorry, nothing to display.', 'dis2019');?></h2>
</article>
<!-- /article -->

<?php endif;?>