Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
51 lines (50 sloc) 1.76 KB
<article id="post-<?php the_ID(); ?>" <?php post_class('presspage-article presspage-small-image'); ?>>
<?php $presslink = press_link(get_the_ID());?>
<div class="row">
<div class="col-sm-5">
<?php
$external_link = get_post_meta(get_the_ID(),'external_link');
if((strlen(get_the_content()) > 0 || !empty($external_link)) && has_post_thumbnail()) {
echo'<a href="'.$presslink.'">'.get_the_post_thumbnail().'</a>';
} elseif(has_post_thumbnail()) {
the_post_thumbnail();
}
?>
</div>
<div class="col-sm-7">
<header class="entry-header">
<h4 class="entry-title">
<?php
if(strlen(get_the_content()) > 0 || !empty($external_link)) {
echo'<a href="'.$presslink.'">'.get_the_title().'</a>';
} else {
the_title();
}
?>
</h4>
<?php
$categories = get_the_category(get_the_ID());
$authors = array();
foreach($categories as $cat){
$parent = get_category($cat->parent);
if($parent->slug == 'authors'){
$authors[] = '<a href="'.esc_url( get_category_link($cat->term_id) ).'" title="'.$cat->name.'">'.$cat->name.'</a>';
}
}
if(count($authors) > 0){
$by = implode(', ', $authors);
}
else {
$by = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
);
}
?>
<p class="post-authors">By <?php echo $by; ?></p>
<?php press_source(get_the_ID());?>
<p class="text-muted"><?php the_time('F j, Y'); ?></p>
</header>
</div>
</div>
</article>
You can’t perform that action at this time.