Skip to content
Permalink
Newer
Older
100644 51 lines (50 sloc) 1.76 KB
1
<article id="post-<?php the_ID(); ?>" <?php post_class('presspage-article presspage-small-image'); ?>>
2
<?php $presslink = press_link(get_the_ID());?>
3
<div class="row">
4
<div class="col-sm-5">
5
<?php
6
$external_link = get_post_meta(get_the_ID(),'external_link');
7
if((strlen(get_the_content()) > 0 || !empty($external_link)) && has_post_thumbnail()) {
8
echo'<a href="'.$presslink.'">'.get_the_post_thumbnail().'</a>';
9
} elseif(has_post_thumbnail()) {
10
the_post_thumbnail();
11
}
12
?>
13
</div>
14
<div class="col-sm-7">
15
<header class="entry-header">
16
<h4 class="entry-title">
17
<?php
18
if(strlen(get_the_content()) > 0 || !empty($external_link)) {
19
echo'<a href="'.$presslink.'">'.get_the_title().'</a>';
20
} else {
21
the_title();
22
}
23
?>
24
</h4>
Roy
Jul 21, 2016
25
<?php
26
$categories = get_the_category(get_the_ID());
27
$authors = array();
28
foreach($categories as $cat){
29
$parent = get_category($cat->parent);
30
if($parent->slug == 'authors'){
31
$authors[] = '<a href="'.esc_url( get_category_link($cat->term_id) ).'" title="'.$cat->name.'">'.$cat->name.'</a>';
32
}
33
}
34
if(count($authors) > 0){
35
$by = implode(', ', $authors);
36
}
37
else {
38
$by = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
39
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
40
esc_html( get_the_author() )
41
);
42
}
43
?>
44
<p class="post-authors">By <?php echo $by; ?></p>
45
<?php press_source(get_the_ID());?>
46
<p class="text-muted"><?php the_time('F j, Y'); ?></p>
47
48
</header>
49
</div>
50
</div>
51
</article>
You can’t perform that action at this time.