<?php
/**
 * Post list item - fresh layout
 *
 * @package Multi
 */

?>
<?php
$multimagazine_args         = wp_parse_args( $args );
$multimagazine_post_classes = 'post-list-item post-fresh col ' . $multimagazine_args['classes'];
if ( is_sticky( get_the_id() ) ) {
	$multimagazine_post_classes .= ' sticky';
}
if ( ! has_post_thumbnail() ) {
	$multimagazine_post_classes .= ' no-image';
}

?>
<article <?php post_class( $multimagazine_post_classes ); ?>>
	<div class="inside">
		<?php if ( has_post_thumbnail() ) : ?>
			<a href="<?php the_permalink(); ?>" class="post-thumbnail"><span class="img-border"><?php the_post_thumbnail( $multimagazine_args['thumbnail-size'] ); ?></span></a>
		<?php endif; ?>
		<?php if ( 'off' !== $multimagazine_args['show_date'] ) : ?>
			<p class="post-date"><span><?php the_time( get_option( 'date_format' ) ); ?></span></p>
		<?php endif; ?>

		<div class="post-head">
			<h2 class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php multimagazine_the_title(); ?></a> <?php edit_post_link( esc_html__( 'Edit this entry', 'multimagazine' ), '', '' ); ?></h2>
			<?php if ( 'off' !== $multimagazine_args['show_author'] ) : ?>
				<p class="post-meta-author"><?php esc_html_e( 'by', 'multimagazine' ); ?> <?php the_author(); ?></p>
			<?php endif; ?>
		</div>
	</div>
	<div class="post-content cf">
		<p class="post-excerpt"><?php echo wp_kses_post( multimagazine_custom_excerpt( 40, $post, $multimagazine_args['show_more'] ) ); ?></p>
		<p class="post-social">
			<?php
			if ( comments_open() ) {
				comments_popup_link( '0', '1', '%', 'comment-link' );
			}
			do_action( 'multimagazine_post_links' );
			?>
		</p>
	</div>
</article>
