-
Notifications
You must be signed in to change notification settings - Fork 40
/
single.php
executable file
·69 lines (59 loc) · 2.09 KB
/
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
<?php get_header(); ?>
<main id="content" class="clearfix" role="main">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<header>
<h1><?php the_title(); ?></h1>
<?php get_template_part( 'inc/meta' ); ?>
</header>
<div class="entry-content">
<?php the_content(); ?>
</div>
<?php
wp_link_pages( array(
'before' => '<div>' . __('Pages »', 'wpflex'),
'after' => '</div>'
));
?>
<?php get_template_part( 'inc/edit-post-link' ); ?>
<?php get_template_part( 'inc/entry-footer' ); ?>
</article>
<?php
// Don't print empty markup if there's nowhere to navigate.
$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous ) : return;
?>
<?php else : ?>
<ul class="pagination-posts">
<?php previous_post_link( '<li>%link</li>', __( '← Previous Category Post', 'wpflex' ) ); ?></li>
<?php next_post_link( '<li>%link</li>', __( 'Next Category Post →', 'wpflex' ) ); ?></li>
</ul>
<?php endif; ?>
<?php
$pagination_defaults = array(
'before' => '<p>' . __( 'Pages:', 'wpflex' ),
'after' => '</p>',
'link_before' => '',
'link_after' => '',
'next_or_number' => 'number',
'separator' => ' ',
'nextpagelink' => __( 'Next page', 'wpflex' ),
'previouspagelink' => __( 'Previous page', 'wpflex' ),
'pagelink' => '%',
'echo' => 1
);
?>
<?php wp_link_pages( $pagination_defaults ); ?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( 'inc/error-msg' ); ?>
<?php endif; ?>
</main>
<?php
if ( comments_open() || '0' != get_comments_number() ) :
comments_template();
endif;
?>
<?php get_template_part( 'inc/widget-sidebar' ); ?>
<?php get_footer(); ?>