-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent-grid.php
More file actions
executable file
·36 lines (32 loc) · 1014 Bytes
/
content-grid.php
File metadata and controls
executable file
·36 lines (32 loc) · 1014 Bytes
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
<?php
/**
* @package Focus
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ( has_post_thumbnail() ) {
$image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'focus-archive', true );
$image = $image[0];
$class = "image-thumbnail";
} else {
$format = get_post_format();
$image = get_template_directory_uri() . '/images/svg/post.svg';
$formats = array( 'audio', 'gallery', 'image', 'link', 'video' );
if ( in_array( $format, $formats ) ) {
$image = get_template_directory_uri() . '/images/svg/' . $format . '.svg';
}
$class = 'fallback-thumbnail';
}
if ( post_password_required() ) {
$image = get_template_directory_uri() . '/images/svg/lock.svg';
$class = 'password-thumbnail';
}
?>
<a href="<?php the_permalink(); ?>">
<figure class="entry-image <?php echo $class; ?>">
<img src="<?php echo $image; ?>" style="width:560px;">
</figure>
<?php the_title( '<div class="entry-title">', '</div>' ); ?>
</a>
</article><!-- #post-## -->