-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-blog-image-medium.php
51 lines (46 loc) · 1.96 KB
/
content-blog-image-medium.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 used for displaying blog image medium post.
*
* @package ThemeGrill
* @subpackage Esteem
* @since Esteem 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php do_action( 'esteem_before_post_content' ); ?>
<div class="blog-content">
<header class="entry-header">
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>"><?php the_title(); ?></a>
</h2><!-- .entry-title -->
</header>
<?php esteem_entry_meta(); ?>
<div class="entry-content clearfix">
<?php
if( has_post_thumbnail() ) {
$image = '';
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'blog-medium' );
$title_attribute = the_title_attribute( 'echo=0' );
$thumb_id = get_post_thumbnail_id( get_the_ID() );
$img_altr = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );
$img_alt = ! empty( $img_altr ) ? $img_altr : $title_attribute;
$image .= '<figure class="post-featured-image">';
$image .= '<a href="' . get_permalink() . '" title="'.the_title_attribute( 'echo=0' ).'">';
$image .= get_the_post_thumbnail( $post->ID, 'blog-medium', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $img_alt ) ) ).'</a>';
$image .= '<div class="mask">
<div class="image-icon-wrap">
<a href="'.$large_image_url[0].'" class="img-icon img-search"><i class="icon-search"></i></a>
<a href="'.get_permalink().'" class="img-icon img-link"><i class="icon-link"></i></a>
</div>
</div>';
$image .= '</figure>';
echo $image;
}
?>
<?php the_excerpt(); ?>
<div class="readmore-wrap"><a class="readmore" href="<?php the_permalink(); ?>"><?php _e( 'Read more', 'esteem' ); ?></a></div>
</div><!-- .entry-content -->
</div>
<?php do_action( 'esteem_after_post_content' ); ?>
</article>