-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
71 lines (57 loc) · 1.73 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
<?php
/**
* The main template file.
*/
$posts = $wp_query->posts;
$paged = (get_query_var('paged', 0)) ? get_query_var('paged', 0) : 1;
get_header();
?>
<div class="container heading">
<?php knd_section_title(); ?>
</div>
<?php if(empty($posts)) { ?>
<div class="main-content listing-bg"><div class="container">
<div class="empty-message"><?php esc_html_e('Unfortunately, nothing found', 'knd');?></div>
</div></div>
<?php } else { ?>
<?php
if($paged == 1) { //featured posts
//2 for featured
$featured = array_slice($posts, 0, 2);
array_splice($posts, 0, 2);
?>
<div class="featured-post listing-bg">
<div class="container">
<div class="flex-row cards-loop">
<?php
foreach($featured as $f){
knd_related_post_card($f);
}
?>
</div>
</div>
</div>
<?php } ?>
<?php if(!empty($posts)):?>
<div class="main-content cards-holder listing-bg archive-post-list <?php if($paged > 1):?>next-page<?php endif?>">
<div class="container">
<div class="flex-row start cards-loop">
<?php
foreach($posts as $p){
knd_post_card($p);
}
?>
</div>
</div>
</div>
<?php endif;?>
<div class="paging listing-bg"><?php knd_paging_nav($wp_query); ?></div>
<?php } ?>
<div class="knd-archive-sidebar">
<?php if(is_home()):?>
<?php dynamic_sidebar( 'knd-news-archive-sidebar' );?>
<?php else: ?>
<?php dynamic_sidebar( 'knd-projects-archive-sidebar' );?>
<?php endif ?>
</div>
<?php get_footer();