-
Notifications
You must be signed in to change notification settings - Fork 1
/
content.php
61 lines (55 loc) · 1.58 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* content.php
*
* the default template for showing the content of the post.
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- article header -->
<header class="entry-header"><?php
// if post has thumbnail and not password protected
// show the post thumbnail
if ( has_post_thumbnail() && ! post_password_required() ) : ?>
<figure class="entry-thumbnail">
<?php the_post_thumbnail( 'blog-thumbs' ); ?>
</figure>
<?php endif;
// display single page title if is single
// else display the title in a anchor tag
if ( is_single() ) : ?>
<h1><?php the_title(); ?></h1>
<?php else : ?>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<?php endif; ?>
<?php
// display the post meta information
opal_post_meta();
?>
</header>
<!-- article content -->
<div class="entry-content">
<?php
if ( is_search() ) {
the_excerpt();
} else {
the_content( __( 'Read More →', 'opal' ) );
wp_link_pages();
}
?>
</div> <!-- .entry-content -->
<!-- article footer -->
<footer class="entry-footer">
<?php
// if we have a single page and the author bio exists
if ( is_single() && get_the_author_meta( 'description' ) ) {
$author_icon = '<i class="fa fa-user"></i> ';
echo '<hr>';
echo '<h3 class="author-title">' . $author_icon . __( 'Written by ', 'opal' ) . get_the_author() . '</h3>';
echo '<p>';
echo the_author_meta( 'description' );
echo '</p>';
}
?>
</footer> <!-- .entry-footer -->
</article>