-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
126 lines (78 loc) · 3.82 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?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.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package understrap-builder
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
global $us_b_title_shown_already;
$us_b_title_shown_already = false;
get_header();
// Load Customizer variables
$understrap_builder_container_type = get_option( 'understrap_builder_container_type', 'container');
$understrap_builder_container_archive_type = get_option( 'understrap_builder_container_archive_type', 'default');
$understrap_builder_breadcrumbs_page_display = get_option( 'understrap_builder_breadcrumbs_page_display', '');
$understrap_builder_hide_title = get_post_meta(get_the_ID(), '_us_b_hide_title', true);
// handle container
if($understrap_builder_container_archive_type != 'default'){
$understrap_builder_container_type = $understrap_builder_container_archive_type;
}
?>
<?php get_template_part( 'global-templates/breadcrumbs-navbar-archive-check' ); ?>
<?php if(is_front_page()){ /* Home page with blog posts */ ?>
<?php get_template_part( 'global-templates/builder-hero-check' ); ?>
<?php get_template_part( 'global-templates/headers-archive-check' ); ?>
<?php } else { /* Blog posts hub /blog/ page */ ?>
<?php if($understrap_builder_breadcrumbs_page_display == 'under-nav'){ get_template_part( 'global-templates/breadcrumbs-page-check'); } ?>
<?php get_template_part( 'global-templates/headers-page-check'); ?>
<?php if($understrap_builder_breadcrumbs_page_display == 'under-header'){ get_template_part( 'global-templates/breadcrumbs-page-check'); } ?>
<?php } ?>
<div class="wrapper" id="index-wrapper">
<div class="<?php echo esc_attr( $understrap_builder_container_type ); ?>" id="content" tabindex="-1">
<div class="row">
<!-- Do the left sidebar check and opens the primary div -->
<?php get_template_part( 'global-templates/left-sidebar-check' ); ?>
<div class="col" id="index-primary">
<div class="row">
<div class="col-12">
<main class="site-main" id="main">
<div class="row">
<?php if ( have_posts() ) : ?>
<?php if($understrap_builder_hide_title != 'hide' && !$us_b_title_shown_already && !is_home()){ ?>
<div class="col-12 mb-4">
<header class="page-header<?php if($understrap_builder_headers_archive == 'centered'){ echo ' text-center';}?>">
<h1><?php single_post_title(); ?></h1>
</header><!-- .page-header -->
</div>
<?php } ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'loop-templates/content', get_post_format() ); ?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( 'loop-templates/content', 'none' ); ?>
<?php endif; ?>
</div>
</main><!-- #main -->
</div>
<?php if(show_posts_nav()){ ?>
<div class="col-12 my-4">
<!-- The pagination component -->
<?php understrap_pagination(); ?>
</div>
<?php } ?>
</div>
</div>
<!-- Do the right sidebar check -->
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
</div><!-- .row -->
</div><!-- #content -->
</div><!-- #index-wrapper -->
<?php get_footer(); ?>