-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-blog.php
109 lines (69 loc) · 2.92 KB
/
template-blog.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
<?php
/*
Template Name: Blog
*/
?>
<div class="parallax-image-wrapper" data-anchor-target=".hero-bg" data-bottom-top="transform:translate3d(0px, 200%, 0px)" data-top-bottom="transform:translate3d(0px, 0%, 0px)">
<div class="parallax-image" style="background-image:url(http://d2gawdwh5o4in5.cloudfront.net/wp-content/themes/rubyfish/assets/img/blog-bg.jpg)" data-anchor-target=".hero-bg" data-bottom-top="transform: translate3d(0px, -60%, 0px);"
data-top-bottom="transform: translate3d(0px, 60%, 0px);"></div>
</div>
<div id="skrollr-body">
<div class="hero-bg" style="background-image:url(http://d2gawdwh5o4in5.cloudfront.net/wp-content/themes/rubyfish/assets/img/blog-bg.jpg);"></div>
<div id="hero">
<div class="hero-text">
<h2><span>If I forget the words, they weren't very memorable in the first place</span></h2>
<p>Willie Nelson</p>
</div>
<!--div id="scroll-to-content"-->
<a id="scroll-to-content" href="#main"><span class="icon-arrow-down"></span></a>
<!--/div-->
</div>
<?php if (!have_posts()) : ?>
<div class="alert alert-warning">
<?php _e('Sorry, no results were found.', 'sage'); ?>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<div id="main" class="site-main">
<div class="container">
<!-- Articles list -->
<div id="content" class="site-content" role="main">
<div class="row">
<div class="col-sm-6 col-xs-12">
<?php
$pitem_counter = 0;
// get post items
$wp_query = new WP_Query();
$wp_query->query('post_type=post&posts_per_page=-1');
while (have_posts()) :
the_post();
if ($wp_query->current_post % 2 == 0):
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):
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', 'sage')); ?></li>
<li class="next"><?php previous_posts_link(__('Newer posts →', 'sage')); ?></li>
</ul>
</nav>
<?php endif; ?>