-
Notifications
You must be signed in to change notification settings - Fork 106
/
content-single.php
executable file
·97 lines (87 loc) · 4.02 KB
/
content-single.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/**
* @package Independent Publisher
* @since Independent Publisher 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
<?php if ( has_post_thumbnail() && !independent_publisher_has_full_width_featured_image() ) : ?>
<?php the_post_thumbnail( 'independent_publisher_post_thumbnail', array( 'itemprop' => 'image' ) ); ?>
<?php endif; ?>
<header class="entry-header">
<?php if ( independent_publisher_post_has_post_cover_title() ): ?>
<h2 class="entry-title-meta">
<span class="entry-title-meta-author">
<?php if ( !independent_publisher_categorized_blog() ) {
echo independent_publisher_entry_meta_author_prefix() . ' ';
}
independent_publisher_posted_author() ?></span>
<?php if ( get_post_meta( get_the_ID(), 'independent_publisher_primary_category', true ) ) { // check for a custom field named 'independent_publisher_primary_category'
echo independent_publisher_entry_meta_category_prefix() . ' ' . get_post_meta( get_the_ID(), 'independent_publisher_primary_category', true ); // show the primary category as set in ACF
} else if ( independent_publisher_categorized_blog() ) {
echo independent_publisher_entry_meta_category_prefix() . ' ' . independent_publisher_post_categories();
} ?>
<span class="entry-title-meta-post-date">
<span class="sep"> <?php echo apply_filters( 'independent_publisher_entry_meta_separator', '|' ); ?> </span>
<?php independent_publisher_posted_on_date() ?>
</span>
<?php do_action( 'independent_publisher_entry_title_meta', $separator = ' | ' ); ?>
</h2>
<?php else: ?>
<h2 class="entry-title-meta">
<span class="entry-title-meta-author">
<?php if ( !independent_publisher_categorized_blog() ) {
echo independent_publisher_entry_meta_author_prefix() . ' ';
}
independent_publisher_posted_author() ?>
</span>
<?php if ( independent_publisher_categorized_blog() ) {
echo independent_publisher_entry_meta_category_prefix() . ' ' . independent_publisher_post_categories();
} ?>
<span class="entry-title-meta-post-date">
<span class="sep"> <?php echo apply_filters( 'independent_publisher_entry_meta_separator', '|' ); ?> </span>
<?php independent_publisher_posted_on_date() ?>
</span>
<?php do_action( 'independent_publisher_entry_title_meta', $separator = ' | ' ); ?>
</h2>
<h1 class="entry-title p-name" itemprop="name"><?php the_title(); ?></h1>
<?php endif; ?>
</header>
<!-- .entry-header -->
<div class="entry-content e-content" itemprop="mainContentOfPage">
<?php the_content(); ?>
<?php if (function_exists('wp_pagenavi')) : // WP-PageNavi support ?>
<?php wp_pagenavi( array( 'type' => 'multipart' ) ); ?>
<?php else : ?>
<?php wp_link_pages(
array(
'before' => '<div class="page-links-next-prev">',
'after' => '</div>',
'nextpagelink' => '<button class="next-page-nav">' . __( 'Next page →', 'independent-publisher' ) . '</button>',
'previouspagelink' => '<button class="previous-page-nav">' . __( '← Previous page', 'independent-publisher' ) . '</button>',
'next_or_number' => 'next'
)
); ?>
<?php wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'independent-publisher' ),
'after' => '</div>'
)
); ?>
<?php endif; ?>
</div>
<!-- .entry-content -->
<?php independent_publisher_posted_author_bottom_card() ?>
<footer class="entry-meta">
<?php do_action( 'independent_publisher_entry_meta_top' ); ?>
<?php if ( comments_open() && !independent_publisher_hide_comments() ) : ?>
<div id="share-comment-button">
<button>
<i class="share-comment-icon"></i><?php echo independent_publisher_comments_call_to_action_text() ?>
</button>
</div>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'independent-publisher' ), '<span class="edit-link">', '</span>' ); ?>
</footer>
<!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->