-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
90 lines (61 loc) · 2.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
<div id="skrollr-body">
<?php if (!have_posts()) : ?>
<div class="alert alert-warning">
<?php _e('Sorry, no results were found.', 'roots'); ?>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<div id="main" class="site-main">
<div class="container offset-top-70 page-template-template-blog-php page-template-template-tags">
<?php get_template_part('templates/page', 'header'); ?>
<!-- Articles list -->
<div id="content" class="site-content" role="main">
<div class="row">
<div class="col-sm-6 col-xs-12">
<?php
while (have_posts()) :
the_post();
if ($wp_query->current_post % 2 == 0):
if(get_post_type() == 'work')
{
get_template_part('templates/content-work', get_post_format());
}
else
{
get_template_part('templates/content-blog', get_post_format());
}
endif;
endwhile;
?>
</div>
<div class="col-sm-6 col-xs-12">
<?php
// This will reset the loop counter and allow you to do another loop.
rewind_posts();
while (have_posts()) :
the_post();
if ($wp_query->current_post % 2 !== 0):
if(get_post_type() == 'work')
{
get_template_part('templates/content-work', get_post_format());
}
else
{
get_template_part('templates/content-blog', get_post_format());
}
endif;
endwhile;
?>
</div>
</div>
</div>
</div>
</div>
<?php if ($wp_query->max_num_pages > 1) : ?>
<nav class="post-nav">
<ul class="pager">
<li class="previous"><?php next_posts_link(__('← Older posts', 'roots')); ?></li>
<li class="next"><?php previous_posts_link(__('Newer posts →', 'roots')); ?></li>
</ul>
</nav>
<?php endif; ?>