This repository has been archived by the owner on Dec 31, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-featured.php
52 lines (43 loc) · 2 KB
/
content-featured.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
52
<?php
/**
* The template for displaying featured content
*
* @package WordPress
* @subpackage RVB
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('post-featured'); ?>>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Read the article "%s"', 'rvb' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark" class="permalink">
<?php if ( has_post_thumbnail() ) : // check if the post has a Post Thumbnail assigned to it. ?>
<figure class="post-thumbnail">
<?php
the_post_thumbnail('large');
// print thumbnail title and/or description, if available
$thumbnail = get_post( get_post_thumbnail_id( $post->ID ) );
if ( $thumbnail->post_excerpt || $thumbnail->post_content ) :
?>
<figcaption class="post-thumbnail-caption">
<?php
if ( $thumbnail->post_excerpt )
echo '<span class="post-thumbnail-title">'.$thumbnail->post_excerpt.'</span>';
if ( $thumbnail->post_excerpt && $thumbnail->post_content )
echo '<span class="sep">›</span>';
if ( $thumbnail->post_content )
echo '<span class="post-thumbnail-description">'.$thumbnail->post_content.'</span>';
?>
</figcaption>
<?php endif; // $thumbnail->post_excerpt || $thumbnail->post_content ?>
</figure>
<?php endif; // has_post_thumbnail() ?>
<header class="entry-header">
<?php the_title('<h1 class="entry-title">', '</h1>'); ?>
<p class="pub-info">
<?php printf( __( '<span class="sep">Posted on </span><time class="entry-date" datetime="%1$s" pubdate>%2$s</time>', 'rvb' ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); ?>
<?php edit_post_link(__('Edit', 'rvb')); ?>
</p>
</header><!-- .entry-header -->
</a>
<div class="entry-content">
<?php the_pretty_excerpt(512); ?>
</div><!-- .entry-content -->
</article><!-- #post-<?php the_ID(); ?> -->