-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
162 lines (156 loc) · 6.5 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
<?php
/**
* Main Template File
* @package advanceBlog
*/
get_header();
?>
<div class="container m-auto lg:px-4 md:px-4 px-4">
<div class="
main__body_content
grid grid-cols-1
lg:grid-cols-3
py-8
lg:gap-x-6
">
<div class="
latest__post_grid
grid grid-cols-1
lg:grid-cols-2 lg:col-span-2 lg:gap-x-6 lg:gap-y-6
gap-y-6
relative
">
<?php
if (have_posts()) :
while (have_posts()) : the_post();
get_template_part('template-parts/content');
endwhile;
else :
get_template_part('template-parts/content', 'none');
endif;
?>
<!-- Pagination -->
<div class="pagination my-8 lg:hidden mobile__pagination">
<ul class="flex items-center m-auto">
<?php advanceBlog_pagination(); ?>
</ul>
</div>
</div>
<div class="sidebar__right">
<div class="about__us_hero border-2">
<div class="logo">
<h1><?php bloginfo('name'); ?></h1>
</div>
<p class="my-6">
<?php bloginfo('description'); ?>
</p>
<div class="socia__follow">
<a href="#"><i class="fa fab fa-facebook-f"></i></a>
<a href="#"><i class="fa fab fa-twitter"></i></a>
<a href="#"><i class="fa fab fa-instagram"></i></a>
</div>
</div>
<div class="popular__posts border-2">
<div class="section__heading mb-7">
<h3>Popular Posts</h3>
</div>
<div class="popular__post_content">
<?php
$popularpost = new WP_Query([
'posts_per_page' => 5,
'meta_key' => 'wpb_post_views_count',
'orderby' => 'meta_value_num',
'order' => 'DESC'
]);
$post_number = 1;
while ($popularpost->have_posts()) : $popularpost->the_post();
?>
<div class="single__popular_post flex items-center">
<div class="thumbs relative">
<?php
if (has_post_thumbnail()) {
?>
<a href="<?php the_permalink(); ?>" style="width: 20%;"><img
src="<?php the_post_thumbnail_url(); ?>"/></a>
<?php
}
?>
<p class="absolute"><?php echo $post_number ?></p>
</div>
<div class="text__content" style="width: 80%;">
<h4>
<a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a>
</h4>
<?php advanceBlog_posted_on(); ?>
</div>
</div>
<?php
$post_number++;
endwhile;
?>
</div>
</div>
<div class="category__sidebar border-2">
<div class="section__heading mb-7">
<h3>Explore Topics</h3>
</div>
<div class="category_lists">
<?php
$category_lists = get_categories([
'orderby' => 'name',
'order' => 'ASC'
]);
if (!empty($category_lists) && is_array($category_lists)) {
foreach ($category_lists as $category) {
?>
<div class="category">
<a href="<?php echo get_category_link($category->term_id) ?>"
class="flex items-center justify-between">
<p>
<i class="fa fas fa-chevron-right pr-2"></i> <?php echo $category->name; ?>
</p>
<span class="count">(<?php echo $category->count; ?>)</span>
</a>
</div>
<?php
}
}
?>
</div>
</div>
<div class="tag__cloud border-2">
<div class="section__heading mb-7">
<h3>Tag Cloud</h3>
</div>
<div class="all_tags">
<?php
$tags = get_tags([
'hide_empty' => false
]);
if (!empty($tags) && is_array($tags)) {
foreach ($tags as $tag) {
?>
<a href="<?php echo get_tag_link($tag->term_id); ?>"
class="tag">#<?php echo $tag->name ?></a>
<?php
}
}
?>
</div>
</div>
<aside id="primary" class="border-2" role="complementary">
<?php dynamic_sidebar('sidebar-2'); ?>
</aside>
</div>
</div>
<!-- Pagination -->
<div class="pagination my-8">
<ul class="flex items-center m-auto">
<?php advanceBlog_pagination(); ?>
</ul>
</div>
</div>
</main>
<?php
get_footer();
?>