Repository navigation
Expand file tree
/
Copy pathpage-debates.php
More file actions
79 lines (63 loc) · 1.64 KB
/
Copy pathpage-debates.php
File metadata and controls
79 lines (63 loc) · 1.64 KB
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
<?php get_header(); ?>
<div id="page-stories">
<h1 class="page-stories-title">Debates</h1>
<div class="line"></div>
</div>
<div class="container">
<div class="page-stories">
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args=array(
'post_type' => 'post',
'category_name' => 'debates',
'post_status' => 'publish',
'posts_per_page' => 6,
'paged' => $paged
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
$i = 0;
while ($my_query->have_posts()) : $my_query->the_post();
// modified to work with 3 columns
// output an open <div>
if($i % 3 == 0) { ?>
<div class="row">
<?php
}
?>
<div class="col-md-4">
<div class="article-snippet">
<div class="post-thumb">
<?php the_post_thumbnail();?>
<h4 class="blog-post-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
<h4 class="blog-post-excerpt">
<?php the_excerpt(); ?>
</h4>
<h6 class="blog-post-author">
<span style="color:#807E7E;">By </span><?php the_author();?>
</h6>
</div>
</h4>
</div>
</div>
<?php $i++;
if($i != 0 && $i % 3 == 0) { ?>
</div><!--/.row-->
<div class="clearfix"></div>
<?php
} ?>
<?php
endwhile;
}
?>
<?php
wp_reset_query();
?>
</div><!--/.container-->
<div class="previous-page-bar"><?php previous_posts_link();?></div>
<div class="next-page-bar"><?php next_posts_link('Next Page', $my_query->max_num_pages);?></div>
<?php get_footer(); ?>