2015-09-26 04:08:27 +02:00
|
|
|
<?php
|
2016-03-10 15:05:06 +01:00
|
|
|
global $post;
|
2015-09-26 04:08:27 +02:00
|
|
|
|
|
|
|
$title = get_the_title();
|
|
|
|
|
|
|
|
$fname = get_the_author_meta('first_name');
|
|
|
|
$lname = get_the_author_meta('last_name');
|
|
|
|
$full_name = '';
|
|
|
|
|
|
|
|
if( empty($fname)){
|
2015-12-17 15:55:34 +01:00
|
|
|
$full_name = $lname;
|
2015-09-26 04:08:27 +02:00
|
|
|
} elseif( empty( $lname )){
|
2015-12-17 15:55:34 +01:00
|
|
|
$full_name = $fname;
|
2015-09-26 04:08:27 +02:00
|
|
|
} else {
|
2015-12-17 15:55:34 +01:00
|
|
|
//both first name and last name are present
|
|
|
|
$full_name = "{$fname} {$lname}";
|
2015-09-26 04:08:27 +02:00
|
|
|
}
|
|
|
|
|
2015-10-02 01:48:59 +02:00
|
|
|
if (strlen($full_name) <= 0) {
|
2015-12-17 15:55:34 +01:00
|
|
|
$full_name = 'ascribe';
|
2015-10-02 01:48:59 +02:00
|
|
|
}
|
|
|
|
|
2016-03-17 14:17:12 +01:00
|
|
|
$url = get_the_permalink();
|
|
|
|
$avatar = get_avatar( get_the_author_meta('ID'), 96 );
|
|
|
|
$excerpt = get_the_excerpt();
|
|
|
|
$teaser = get_the_post_thumbnail($post->ID, 'blog-teaser');
|
2015-11-02 11:18:22 +01:00
|
|
|
|
2015-09-26 04:08:27 +02:00
|
|
|
?>
|
|
|
|
|
2016-03-10 15:05:06 +01:00
|
|
|
<article <?php post_class( '', $post->ID ); ?>>
|
2015-12-17 15:55:34 +01:00
|
|
|
|
2016-03-17 14:17:12 +01:00
|
|
|
<header class="entry-header">
|
2015-12-17 15:55:34 +01:00
|
|
|
<?php
|
2016-03-17 14:17:12 +01:00
|
|
|
echo get_the_category_list();
|
|
|
|
echo "<h1 class='entry-title'><a href='{$url}'>{$title}</a></h1>";
|
2015-12-17 15:55:34 +01:00
|
|
|
|
2016-03-17 14:17:12 +01:00
|
|
|
// Show custom post excerpt when set
|
|
|
|
if ( is_singular() && has_excerpt() ) {
|
|
|
|
echo "<div class='entry-lead'>{$excerpt}</div>";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</header>
|
2015-12-17 15:55:34 +01:00
|
|
|
|
2016-03-17 14:17:12 +01:00
|
|
|
<?php if ( has_post_thumbnail() ) { ?>
|
|
|
|
<div class="entry-teaser">
|
|
|
|
<?php if ( is_singular() ) {
|
|
|
|
echo $teaser;
|
2016-03-10 15:18:34 +01:00
|
|
|
} else {
|
2016-03-17 14:17:12 +01:00
|
|
|
echo "<a href='{$url}'>{$teaser}</a>";
|
2016-03-10 15:18:34 +01:00
|
|
|
}
|
2016-03-17 14:17:12 +01:00
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
2016-01-16 18:46:45 +01:00
|
|
|
|
|
|
|
<div class="entry-meta">
|
2016-03-10 15:05:06 +01:00
|
|
|
<?php echo $avatar; ?>
|
2015-12-17 15:55:34 +01:00
|
|
|
<span class="author">by <?php echo $full_name; ?></span>
|
|
|
|
on <date><?php the_time( get_option( 'date_format' ) ); ?></date>
|
|
|
|
</div>
|
|
|
|
|
2016-01-16 18:46:45 +01:00
|
|
|
<main class="entry-content">
|
2015-12-17 15:55:34 +01:00
|
|
|
<?php
|
|
|
|
if ( ! is_singular() ) {
|
2016-03-17 14:17:12 +01:00
|
|
|
echo "<p>{$excerpt}</p>";
|
2016-01-16 18:46:45 +01:00
|
|
|
echo "<a class='button small' href='{$url}'>Read More</a>";
|
2015-12-17 15:55:34 +01:00
|
|
|
} else {
|
|
|
|
the_content();
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</main>
|
|
|
|
</article>
|