-
Notifications
You must be signed in to change notification settings - Fork 1
/
content.php
executable file
·42 lines (40 loc) · 1.41 KB
/
content.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* The default template for displaying content. Used for both single and index/archive/search.
*
* @package WordPress_Themes
* @subpackage Gridlock
*/
?>
<div id="id-<?php the_ID(); ?>" <?php post_class(); ?> >
<div class="row row-article row-<?php echo strtolower(get_cat()) ?>">
<?php
$image_url = false;
if (has_post_thumbnail()) {
$image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "medium", false, '');
$image_url = $image_url[0];
} else {
$image_url = catch_image();
}
?>
<?php if ($image_url) { ?>
<div class="article-image col-6">
<a href="<?php the_permalink(); ?>">
<div class="image" style="background-image: url(<?php echo $image_url ?>)"></div>
</a>
</div>
<div class="article-description col-6">
<?php } else { ?>
<div class="article-description col-12">
<?php } ?>
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'gridlock' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"<?php the_title(); ?> >
<h4 class"article-title"> <?php the_title(); ?> </h4>
</a>
<?php echo colorbox(strtolower(get_cat())); ?>
<small class="text-muted">
<?php coauthors_posts_links(", ", " and "); ?>
</small>
<?php the_excerpt(); ?>
</div>
</div>
</div>