<?php
/**
 * Copyright © 2015 Ihor Vansach (ihor@magefan.com). All rights reserved.
 * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
 *
 * Glory to Ukraine! Glory to the heroes!
 */
?>
<?php
/**
 * Blog sidebar recent posts template
 *
 * @var $block \Magefan\Blog\Block\Sidebar\Recent
 */
?>

<?php
	$_postCollection = $block->getPostCollection();
?>
<?php if ($_postCollection->count()) { ?>
	<div class="post-slide">
		<?php foreach ($_postCollection as $_post) { ?>
			<?php $post_date = $_post->getData("publish_time");?>
			  <div class="post-item-small">
					<a href="<?php echo $_post->getPostUrl() ?>" ><?php echo $block->escapeHtml($_post->getTitle()) ?></a>
			    <div class="post-date">
						<?php echo date("M j, Y", strtotime($post_date)); ?>
					</div>
			  </div>
		<?php } ?>
	</div>
<?php } ?>
