<?php
/**
 * The template for displaying posts in the Link post format
 * @package WordPress
 */
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<header class="entry-header">
	<?php
	if ( is_single() ) {
		the_title( '<h2 class="entry-title">', '</h2>' );
	} else {
		the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
	}

	$storeup_format_link = get_post_meta( $post->ID, 'link_url', true );
	if ( ! empty( $storeup_format_link ) ) {
		echo '<h4 class="sub-title"><a href="'.esc_url( $storeup_format_link ).'" rel="bookmark" target="_blank"><i class="fa fa-link fa-fw"></i>&nbsp;'. esc_url( $storeup_format_link ) .'</a></h4>';
	}
	?>

	<?php if ( is_single() ) { ?>
		<?php if ( get_option( 'storeup_postmeta' ) !== 'on' ) { ?>
		<div class="entry-meta">
			<?php storeup_post_metadata(); ?>
		</div>
		<?php } ?>
	<?php } ?>
	</header><!-- .entry-header -->
	<div class="entry-content">
	<?php
	if ( has_excerpt() && ! is_single() ) {
		the_excerpt();
		echo '<a class="more-link" href="'.esc_url( get_permalink() ) .'">'. esc_html__( 'Read More','storeup' ) .'</a>';
	} else {
		the_content( esc_html__( 'Read More', 'storeup' ) );

		wp_link_pages( array(
			'before'      => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'storeup' ) . '</span>',
			'after'       => '</div>',
			'link_before' => '<span>',
			'link_after'  => '</span>',
		));
	} ?>
	<?php if ( is_single() ) { the_tags(); } ?>
	</div><!-- .entry-content -->
</article><!-- /post-<?php the_ID();?> -->
<?php
