-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
44 lines (32 loc) · 1.08 KB
/
home.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
<!-- Template file for displaying latests posts -->
<?php get_header(); ?>
<div class="container p-y-3">
<?php
$places_args = array(
'posts_per_page' => 6,
'post_type' => 'post',
'orderby' => 'date',
'order' => 'DESC',
'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 )
);
$places_query = new WP_Query( $places_args );
if( $places_query->have_posts() ):
while( $places_query->have_posts() ) : $places_query->the_post();
get_template_part( 'content', get_post_format() );
endwhile;
?>
<?php
//hack fix for pagination see: http://wordpress.stackexchange.com/questions/120407/how-to-fix-pagination-for-custom-loops/120408#120408
$temp_query = $wp_query;
$wp_query = NULL;
$wp_query = $places_query;
if ( function_exists('wp_bootstrap_pagination') )
wp_bootstrap_pagination();
//reset main query
$wp_query = NULL;
$wp_query = $temp_query;
endif;
wp_reset_query();
?>
</div> <!-- /.container -->
<?php get_footer(); ?>