-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontent-image.php
51 lines (39 loc) · 1.45 KB
/
content-image.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
43
44
45
46
47
48
49
50
51
<?php
/**
* The template for displaying the image post format on archives.
*
* @package Silk Lite
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header entry-header--card">
<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta entry-meta--card">
<?php silklite_posted_on_and_cats(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
<?php the_title( sprintf( '<h2 class="entry-title entry-title--card"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php if ( has_post_thumbnail() ) { ?>
<a href="<?php the_permalink(); ?>" class="entry-featured entry-thumbnail" aria-hidden="true">
<?php the_post_thumbnail( silklite_get_thumbnail_size() ); ?>
<div class="entry-image-border"></div>
</a>
<?php } else { // we need to search in the content for an image - maybe we find one
$first_image = silklite_get_post_format_first_image();
if ( ! empty( $first_image ) ) : ?>
<div class="entry-featured entry-thumbnail">
<?php echo $first_image; ?>
<div class="entry-image-border"></div>
</div>
<?php endif;
} ?>
<span class="separator separator-wrapper--accent">
<?php get_template_part( 'assets/svg/separator-simple' ); ?>
</span>
</div><!-- .entry-content -->
</article><!-- #post-## -->