-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
80 lines (77 loc) · 2.19 KB
/
index.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
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link http://western.oa-bsa.org/
*
* @package WordPress
* @subpackage WR
* @since 1.0
* @version 2.0
*/
get_header();
if(!is_paged()){
get_template_part('banner');
}
?>
<main class="index">
<?php !is_paged() ? get_template_part('sidebar') : ''; ?>
<script>
$(document).ready(function() {
var $grid = $('#grid').isotope({
itemSelector: '.grid-item',
percentPosition: true
});
$grid.imagesLoaded().progress(function() {
$grid.isotope('layout');
});
});
</script>
<section class="posts">
<header class="divider">
<h3><span><?php echo get_bloginfo( 'name' ); ?> News</span></h3>
</header>
<div class="container">
<div class="row grid" id="grid">
<?php
// Iteriate through the first 10 non-sticky posts
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post__not_in' => get_option( 'sticky_posts' ),
'posts_per_page' => get_option( 'posts_per_page' ),
'paged' => $paged
);
$wp_query = new WP_Query( $args );
if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();
?>
<div class="col-xs-12 col-sm-6 grid-item">
<div class="card post">
<?php get_featured_image(); ?>
<div class="card-body">
<h2><a class="post-link" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<div class="post-date date">
<time datetime="" itemprop="datePublished">
<?php the_time('F jS, Y') ?> <?php edit_post_link('edit'); ?>
</time>
</div>
<?php the_content(); ?>
</div>
</div>
</div>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
</div>
<div class="row">
<div class="col-12">
<?php bittersweet_pagination(); ?>
</div>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>