<?php
/**
 * @package My Life
 * @since My Life 1.0
 */

$format = get_post_format();

if ( false == $format)
	$format = 'standard';

?>

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

		<?php if ( is_sticky() && '' != get_the_post_thumbnail() ) : // Only display post thumbnails for Sticky posts ?>
			<?php the_post_thumbnail( 'post-thumbnail', array( 'class' => 'thumbnail' ) ); ?>
		<?php endif; ?>

		<?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>

		<?php if ( 'post' == get_post_type() && 'standard' == $format ) : ?>
		<div class="entry-meta">
			<?php my_life_posted_on(); ?>
			<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
				<span class="sep"> | </span>
				<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'my-life' ), __( '1 Comment', 'my-life' ), __( '% Comments', 'my-life' ) ); ?></span>
			<?php endif; ?>
			<?php edit_post_link( __( 'Edit', 'my-life' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>
		</div><!-- .entry-meta -->
		<?php endif; ?>
	</header><!-- .entry-header -->

	<?php if ( is_search() || is_sticky() ) : // Only display Excerpts for Search or Sticky posts ?>
	<div class="entry-summary">
		<?php the_excerpt(); ?>
	</div><!-- .entry-summary -->
	<?php else : ?>
	<div class="entry-content">
		<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'my-life' ) ); ?>
		<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'my-life' ), 'after' => '</div>' ) ); ?>
	</div><!-- .entry-content -->
	<?php endif; ?>

	<footer class="entry-meta">

		<?php if ( 'standard' != $format ) : ?>
			<a class="entry-format" href="<?php echo esc_url( get_post_format_link( get_post_format() ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'my-life' ), get_post_format_string( get_post_format() ) ) ); ?>"><?php echo get_post_format_string( get_post_format() ); ?></a>
			<span class="sep"> | </span>
			<?php my_life_posted_on(); ?>
		<?php endif;//'standard' != $format ?>

		<?php if ( 'post' == get_post_type() && 'standard' == $format ) : // Hide category and tag text for pages on Search or formatted posts ?>
			<?php
				/* translators: used between list items, there is a space after the comma */
				$categories_list = get_the_category_list( __( ', ', 'my-life' ) );
				if ( $categories_list && my_life_categorized_blog() ) :
			?>
			<span class="cat-links">
				<?php printf( __( 'Posted in %1$s', 'my-life' ), $categories_list ); ?>
			</span>
			<?php endif; // End if categories ?>

			<?php
				/* translators: used between list items, there is a space after the comma */
				the_tags( sprintf( '<span class="sep"> | </span><span class="tags-links">%s ', esc_html__( 'Tagged', 'my-life' ) ), esc_html__( ', ', 'my-life' ), '</span>' ); ?>
		<?php endif; // End if 'post' == get_post_type() ?>
		<?php if ( 'standard' != $format ) : ?>
			<?php edit_post_link( __( 'Edit', 'my-life' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>
		<?php endif;//'standard' != $format ?>
	</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->