This repository has been archived by the owner on Aug 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
home-sticky-posts.php
67 lines (55 loc) · 1.67 KB
/
home-sticky-posts.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
<?php
get_header();
$query = new TEDxQuery();
$sticky_posts = $query->sticky_posts(5);
$unsticky_posts = $query->unsticky_posts();
?>
<?php if (count($sticky_posts) > 0 && $query->current_page() === 1): ?>
<div class="sticky-posts">
<div class="container">
<div class="row">
<?php
// If there is only one featured (sticky) post
if (count($sticky_posts) === 1) {
require('partials/blog/_single_sticky.php');
}
// If there are more than one featured (sticky) post
if (count($sticky_posts) > 1) {
require('partials/blog/_grouped_stickies.php');
}
?>
</div>
<!-- .row -->
</div>
<!-- .container -->
</div><!-- .sticky-posts -->
<?php endif; ?>
<div class="container spacing-top">
<div class="row">
<div class="col-md-9">
<div class="page-header">
<h4>Press Releases</h4>
</div>
<!-- .page-header -->
<?php
if (count($unsticky_posts) > 0):
global $post;
foreach ($unsticky_posts as $index => $post):
setup_postdata($post);
WP_Render::partial('partials/blog/_post_excerpt.php');
endforeach;
else:
WP_Render::partial('partials/_not_found.php', ['message' => 'There do not appear to be any posts here…']);
endif;
?>
<?php WP_Render::partial('partials/_pagination.php', ['offset' => count($sticky_posts)]); ?>
</div>
<!-- .col-md-8 -->
<div class="col-md-3">
<?php get_sidebar(); ?>
</div>
<!-- .col-md-4 -->
</div>
<!-- .row -->
</div><!-- .container -->
<?php get_footer(); ?>