forked from mapsteps/page-builder-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
138 lines (81 loc) · 3.56 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
/**
* Single
*
* @package Page Builder Framework
*/
// exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
// vars
$grid_gap = get_theme_mod( 'sidebar_gap', 'medium' );
$template_parts_header = get_theme_mod( 'single_sortable_header', array( 'title', 'meta', 'featured' ) );
$template_parts_footer = get_theme_mod( 'single_sortable_footer', array( 'categories' ) );
get_header(); ?>
<div id="content">
<?php do_action( 'wpbf_content_open' ); ?>
<?php if( !is_singular( array( 'elementor_library', 'et_pb_layout', 'wpbf_hooks' ) ) ) : ?>
<?php wpbf_inner_content(); ?>
<?php do_action( 'wpbf_inner_content_open' ); ?>
<div class="wpbf-grid wpbf-main-grid wpbf-grid-<?php echo esc_attr( $grid_gap ); ?>">
<?php do_action( 'wpbf_sidebar_left' ); ?>
<main id="main" class="wpbf-main wpbf-medium-2-3<?php echo wpbf_singular_class(); // WPCS: XSS ok. ?>">
<?php do_action( 'wpbf_before_article' ); ?>
<?php if( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> itemscope="itemscope" itemtype="https://schema.org/CreativeWork">
<header class="article-header">
<?php
if ( !empty( $template_parts_header ) && is_array( $template_parts_header ) ) {
foreach ( $template_parts_header as $part ) {
get_template_part( 'inc/template-parts/single/single-' . $part );
}
}
?>
</header>
<section class="entry-content article-content" itemprop="text">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'page-builder-framework' ),
'after' => '</div>',
) );
?>
</section>
<footer class="article-footer">
<?php
if ( !empty( $template_parts_footer ) && is_array( $template_parts_footer ) ) {
foreach ( $template_parts_footer as $part ) {
get_template_part( 'inc/template-parts/single/single-' . $part );
}
}
?>
<?php if( get_theme_mod( 'single_post_nav' ) !== 'hide' ) { ?>
<?php do_action( 'wpbf_before_post_links' ); ?>
<nav class="post-links wpbf-clearfix" aria-label="<?php _e( 'Post Navigation', 'page-builder-framework' ); ?>">
<span class="screen-reader-text"><?php _e( 'Post Navigation', 'page-builder-framework' ) ?></span>
<?php
previous_post_link( '<span class="previous-post-link">%link</span>', apply_filters( 'wpbf_previous_post_link', __( '← Previous Post', 'page-builder-framework' ) ) );
next_post_link( '<span class="next-post-link">%link</span>', apply_filters( 'wpbf_next_post_link', __( 'Next Post →', 'page-builder-framework' ) ) );
?>
</nav>
<?php do_action( 'wpbf_after_post_links' ); ?>
<?php } ?>
</footer>
<?php do_action( 'wpbf_before_comments' ); ?>
<?php comments_template(); ?>
<?php do_action( 'wpbf_after_comments' ); ?>
</article>
<?php endwhile; endif; ?>
<?php do_action( 'wpbf_after_article' ); ?>
</main>
<?php do_action( 'wpbf_sidebar_right' ); ?>
</div>
<?php do_action( 'wpbf_inner_content_close' ); ?>
<?php wpbf_inner_content_close(); ?>
<?php else : ?>
<?php if( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
<?php endif; ?>
<?php do_action( 'wpbf_content_close' ); ?>
</div>
<?php get_footer(); ?>