forked from MITLibraries/MITLibraries-news
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadditionalPosts-news.php
61 lines (50 loc) · 1.85 KB
/
additionalPosts-news.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
/*
Template Name: Additional Posts News
*/
$offset = htmlspecialchars(trim($_GET['offset']));
if ($offset == '') {
$offset = 9;
}
$limit = htmlspecialchars(trim($_GET['limit']));
if ($limit == '') {
$limit = 9;
}
?>
<script type="text/javascript">
$(document).ready(function() {
$("img.img-responsive").lazyload({
effect : "fadeIn",
effectspeed: 450 ,
failure_limit: 999999
});
});
</script>
<?php
$sticky = get_option( 'sticky_posts' );
// args
$args2 = array(
'post_type' => 'post',
'post__not_in' => array($sticky),
'posts_per_page' => $limit,
'offset' =>'10',
'ignore_sticky_posts' => true,
'order' => 'DESC',
'orderby' => 'date',
'meta_query' => array(
array(
'key' => 'is_event',
'value' => '1',
'compare' => '!=',
'type' => 'NUMERIC',
),
),
);
$the_query = new WP_Query($args2);
?>
<?php if( $the_query->have_posts() ): ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php renderRegularCard( $i, $post ); // --- CALLS REGULAR CARDS --- // ?>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>