-
Notifications
You must be signed in to change notification settings - Fork 0
/
loop-classic.php
61 lines (39 loc) · 1.33 KB
/
loop-classic.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
<?php
/**
* Classic Blog Style "loop" to display posts
*/
?>
<?php
global $bunyad_loop;
if (!is_object($bunyad_loop)) {
$bunyad_loop = $wp_query;
}
if ($bunyad_loop->have_posts()):
$attribs = array('class' => array('listing-classic', Bunyad::registry()->listing_class));
if (Bunyad::options()->pagination_type == 'infinite') {
$attribs['data-infinite'] = Bunyad::markup()->unique_id('listing-');
}
?>
<div <?php Bunyad::markup()->attribs('loop', $attribs); ?>>
<?php
while ($bunyad_loop->have_posts()):
$bunyad_loop->the_post();
?>
<?php get_template_part('content', get_post_format()); ?>
<?php
endwhile;
?>
</div>
<?php if (!Bunyad::options()->blog_no_pagination): // pagination can be disabled ?>
<div class="main-pagination">
<?php echo Bunyad::posts()->paginate(array(), $bunyad_loop); ?>
</div>
<?php endif; ?>
<?php elseif (is_archive()): // show error on archive only ?>
<article id="post-0" class="page no-results not-found">
<div class="post-content">
<h1><?php _e( 'Nothing Found!', 'bunyad' ); ?></h1>
<p><?php _e('Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'bunyad'); ?></p>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>