-
Notifications
You must be signed in to change notification settings - Fork 0
/
loop-grid.php
61 lines (51 loc) · 1.8 KB
/
loop-grid.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
/**
* The loop to show posts in columns
*
* loop-grid.php
*
* @package WordPress
* @subpackage elevel.tv
* @since 3.0.0
*/
?>
<?php if ( ! have_posts() ) : ?>
<div id="post-0" class="post error404 not-found">
<h1 class="entry-title"><?php _e( 'Not Found', 'elevel_website' ); ?></h1>
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested Archive. Perhaps searching will help find a related post.', 'elevel_website' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</div><!-- #post-0 -->
<?php endif; ?>
<?php /* Start the Loop */ ?>
<?php $num_cols = 4; // set the number of columns here
for ( $i=1 ; $i <= $num_cols; $i++ ) :
echo '<div id="col-' . $i . '" class="col" >';
$counter = $num_cols + 1 - $i; ?>
<?php while (have_posts()) : the_post();
if( $counter%$num_cols == 0 ) :
// begin of core posts output ?>
<div class="cap-bot">
<div class="box entry-featured-image">
<?php the_post_thumbnail(); ?>
<figcaption><?php the_title(); ?>
<?php //end of posts output
endif; $counter++;
endwhile;
rewind_posts();
echo '</div>'; //closes the column div
endfor; ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<!--?php if(function_exists('wp_paginate')) {
wp_paginate();
} ?-->
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id="nav-below" class="navigation">
<?php if(function_exists('page_navi')) { page_navi(); } else { ?>
<div class="nav-next"><?php previous_posts_link( __( '← Back <span class="meta-nav"></span>', 'elevel_website' ) ); ?></div>
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav"></span> More →', 'elevel_website' ) ); ?></div>
<?php } ?>
</div><!-- #nav-below -->
<?php endif;
wp_reset_query(); ?>