forked from bootscore/bootscore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
193 lines (161 loc) · 7.02 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?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 Bootscore
* @version 6.0.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
get_header();
?>
<div id="content" class="site-content <?= apply_filters('bootscore/class/container', 'container', 'index'); ?> <?= apply_filters('bootscore/class/content/spacer', 'pt-4 pb-5', 'index'); ?>">
<div id="primary" class="content-area">
<main id="main" class="site-main">
<!-- Header -->
<div class="p-5 text-center bg-body-tertiary rounded mb-4">
<h1><?php bloginfo('name'); ?></h1>
<p class="lead mb-0"><?php bloginfo('description'); ?></p>
</div>
<!-- Sticky Post -->
<?php if (is_sticky() && is_home() && !is_paged()) : ?>
<div class="row">
<div class="col">
<?php
$args = array(
'posts_per_page' => 2,
'post__in' => get_option('sticky_posts'),
'ignore_sticky_posts' => 2
);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) :
while ($the_query->have_posts()) : $the_query->the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="card horizontal mb-4">
<div class="row g-0">
<?php if (has_post_thumbnail()) : ?>
<div class="col-lg-6 col-xl-5 col-xxl-4">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('medium', array('class' => 'card-img-lg-start')); ?>
</a>
</div>
<?php endif; ?>
<div class="col">
<div class="card-body">
<div class="row">
<div class="col-10">
<?php bootscore_category_badge(); ?>
</div>
<div class="col-2 text-end">
<span class="badge text-bg-danger"><i class="fa-solid fa-star"></i></span>
</div>
</div>
<a class="text-body text-decoration-none" href="<?php the_permalink(); ?>">
<?php the_title('<h2 class="blog-post-title h5">', '</h2>'); ?>
</a>
<?php if ('post' === get_post_type()) : ?>
<p class="meta small mb-2 text-body-secondary">
<?php
bootscore_date();
bootscore_author();
bootscore_comments();
bootscore_edit();
?>
</p>
<?php endif; ?>
<p class="card-text">
<a class="text-body text-decoration-none" href="<?php the_permalink(); ?>">
<?= strip_tags(get_the_excerpt()); ?>
</a>
</p>
<p class="card-text">
<a class="read-more" href="<?php the_permalink(); ?>">
<?php _e('Read more »', 'bootscore'); ?>
</a>
</p>
<?php bootscore_tags(); ?>
</div>
</div>
</div>
</div>
</article>
<?php
endwhile;
endif;
wp_reset_postdata();
?>
</div>
<!-- col -->
</div>
<!-- row -->
<?php endif; ?>
<!-- Post List -->
<div class="row">
<div class="<?= apply_filters('bootscore/class/main/col', 'col'); ?>">
<!-- Grid Layout -->
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php if (is_sticky()) continue; //ignore sticky posts
?>
<div class="card horizontal mb-4">
<div class="row g-0">
<?php if (has_post_thumbnail()) : ?>
<div class="col-lg-6 col-xl-5 col-xxl-4">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('medium', array('class' => 'card-img-lg-start')); ?>
</a>
</div>
<?php endif; ?>
<div class="col">
<div class="card-body">
<?php bootscore_category_badge(); ?>
<a class="text-body text-decoration-none" href="<?php the_permalink(); ?>">
<?php the_title('<h2 class="blog-post-title h5">', '</h2>'); ?>
</a>
<?php if ('post' === get_post_type()) : ?>
<p class="meta small mb-2 text-body-secondary">
<?php
bootscore_date();
bootscore_author();
bootscore_comments();
bootscore_edit();
?>
</p>
<?php endif; ?>
<p class="card-text">
<a class="text-body text-decoration-none" href="<?php the_permalink(); ?>">
<?= strip_tags(get_the_excerpt()); ?>
</a>
</p>
<p class="card-text">
<a class="read-more" href="<?php the_permalink(); ?>">
<?php _e('Read more »', 'bootscore'); ?>
</a>
</p>
<?php bootscore_tags(); ?>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<div class="entry-footer">
<?php bootscore_pagination(); ?>
</div>
</div>
<!-- col -->
<?php get_sidebar(); ?>
</div>
<!-- row -->
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- #content -->
<?php
get_footer();