<?php if ( (!$wp_query->current_post == 1 && is_home() && !is_paged()) || (!$wp_query->current_post == 1 && is_category() && !is_paged()) ) : ?>
<article class="teaser" id="first">
<div class="thumbnail" id="first-thumbnail"><a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('first-thumbnail'); ?></a></div>
<div class="content-container">
<h2><a href="<?php the_permalink(); ?>" class="title"><?php the_title() ;?></a></h2>
<?php if ( has_excerpt() ) { ?>
<p class="excerpt-content">
<?php
$myExcerpt = get_the_excerpt();
$tags = array("<p>", "</p>");
$myExcerpt = str_replace($tags, "", $myExcerpt);
echo $myExcerpt;
?>
</p>
<?php } else {
echo '';
} ?>
<div class="metadata">
<!--<a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><i class="fa fa-user"></i><?php the_author(); ?></a>-->
<a href="<?php echo get_post_meta($post->ID, 'source', true) ?>" target="_blank"><i class="fa fa-external-link-square"></i><?php echo get_post_meta($post->ID, 'source-name', true) ?></a>
<p><i class="fa fa-clock-o"></i><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></p>
<!-- Category
<?php
$categories = get_the_category();
$output = '';
if ($categories) {
foreach ($categories as $category) {
$output .= '<a href="' . get_category_link($category->term_id) . '">' . '<i class="fa fa-thumb-tack"></i>' . $category->cat_name . '</a>';
}
echo trim($output, $separator);
}
?>
/Category -->
<a href="<?php the_permalink(); ?>#comments"><i class="fa fa-comment-o"></i><fb:comments-count href="<?php echo get_permalink($post->ID); ?>"></fb:comments-count> comments</a>
</div>
</div>
</article>
<?php elseif (is_single()) : ?>
<article class="single">
<h2><?php the_title(); ?></h2>
<div id="metadata">
<?php get_template_part('single-metadata', get_post_format()); ?>
<?php echo sharing_display(); ?>
</div>
<div class="single-container">
<?php the_content(); ?>
</div>
<span id="source">source: <a href="<?php echo get_post_meta($post->ID, 'source', true) ?>" target="_blank" id="source"><?php echo get_post_meta($post->ID, 'source-name', true) ?></a></span>
<div class="next">
Up Next:  <?php
$next_post = get_next_post();
if (!empty( $next_post )): ?>
<a href="<?php echo get_permalink( $next_post->ID ); ?>"><?php echo $next_post->post_title; ?></a>
<?php endif; ?>
</div>
<?php get_template_part('single-sharebar', get_post_format()); ?>
<?php related_posts() ?>
<div id="comments"><?php echo do_shortcode('[fbcomments]'); ?></div>
</article>
<?php else : ?>
<article class="teaser">
<div class="thumbnail"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('small-thumbnail'); ?></a></div>
<div class="content-container">
<h2><a href="<?php the_permalink(); ?>" class="title"><?php the_title() ;?></a></h2>
<?php if ( has_excerpt() ) { ?>
<p class="excerpt-content">
<?php
$myExcerpt = get_the_excerpt();
$tags = array("<p>", "</p>");
$myExcerpt = str_replace($tags, "", $myExcerpt);
echo $myExcerpt;
?>
</p>
<?php } else {
echo '';
} ?>
<div class="metadata">
<!--<a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><i class="fa fa-user"></i><?php the_author(); ?></a>-->
<a href="<?php echo get_post_meta($post->ID, 'source', true) ?>" target="_blank"><i class="fa fa-external-link-square"></i><?php echo get_post_meta($post->ID, 'source-name', true) ?></a>
<p><i class="fa fa-clock-o"></i><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></p>
<!-- Category -->
<!--<?php
$categories = get_the_category();
$output = '';
if ($categories) {
foreach ($categories as $category) {
$output .= '<a href="' . get_category_link($category->term_id) . '">' . '<i class="fa fa-thumb-tack"></i>' . $category->cat_name . '</a>';
}
echo trim($output, $separator);
}
?>
<!-- /Category -->
<a href="<?php the_permalink(); ?>#comments"><i class="fa fa-comment-o"></i><fb:comments-count href="<?php echo get_permalink($post->ID); ?>"></fb:comments-count> comments</a>
</div>
</div>
</article>
<?php endif; ?>