-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
102 lines (82 loc) · 3.15 KB
/
index.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
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WP_Bootstrap_4
*/
get_header(); ?>
<?php
$default_sidebar_position = get_theme_mod( 'default_sidebar_position', 'right' );
?>
<?php if ( get_theme_mod( 'blog_display_cover_section', 1 ) ) : ?>
<?php if( get_theme_mod( 'blog_cover_title' ) || get_theme_mod( 'blog_cover_lead' ) || get_theme_mod( 'blog_cover_btn_text' ) ) : ?>
<section class="jumbotron bg-white text-center wp-bs-4-jumbotron border-bottom">
<div class="container-fluid">
<h1 class="jumbotron-heading"><?php echo wp_kses_post( get_theme_mod( 'blog_cover_title' ) ); ?></h1>
<p class="lead text-muted"><?php echo wp_kses_post( get_theme_mod( 'blog_cover_lead' ) ); ?></p>
<?php if( get_theme_mod( 'blog_cover_btn_text' ) ) : ?><a href="<?php echo esc_url( get_theme_mod( 'blog_cover_btn_link' ) ); ?>" class="btn btn-primary"><?php echo esc_html( get_theme_mod( 'blog_cover_btn_text' ) ); ?></a><?php endif; ?>
</div>
<!-- /.container -->
</section>
<!-- /.jumbotron text-center -->
<?php endif; ?>
<?php endif; ?>
<div class="container-fluid">
<div class="row">
<?php if ( $default_sidebar_position === 'no' ) : ?>
<div class="col-md-12 wp-bp-content-width">
<?php else : ?>
<div class="col-md-8 wp-bp-content-width">
<?php endif; ?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
if ( have_posts() ) :
if ( is_home() && ! is_front_page() ) : ?>
<header>
<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
</header>
<?php
endif;
if( get_theme_mod( 'blog_display_posts_slider', '1' ) && is_home() && !is_paged() ) {
get_template_part( 'template-parts/posts-slider' );
}
/* Start the Loop */
while ( have_posts() ) : the_post();
// Include the Post-Format-specific template for the content.
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
the_posts_navigation( array(
'next_text' => esc_html__( 'Newer Posts', 'wp-bootstrap-4' ),
'prev_text' => esc_html__( 'Older Posts', 'wp-bootstrap-4' ),
) );
else :
get_template_part( 'template-parts/content', 'none' );
endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
</div>
<!-- /.col-md-8 -->
<?php if ( $default_sidebar_position != 'no' ) : ?>
<?php if ( $default_sidebar_position === 'right' ) : ?>
<div class="col-md-4 wp-bp-sidebar-width">
<?php elseif ( $default_sidebar_position === 'left' ) : ?>
<div class="col-md-4 order-md-first wp-bp-sidebar-width">
<?php endif; ?>
<?php get_sidebar(); ?>
</div>
<!-- /.col-md-4 -->
<?php endif; ?>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<?php
get_footer();