-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
128 lines (101 loc) · 4.01 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php get_header(); ?>
<?php
$archive_category = false;
$queried_object = get_queried_object();
if($queried_object) {
if(get_class($queried_object) == 'WP_Term') {
$archive_category = $queried_object->name;
}
}
?>
<!-- index.php -->
<main role="main" class="has-sidebar blog">
<!-- section -->
<section>
<?php if(get_search_query()) : ?>
<h1><?php echo sprintf( __( '%s Search Results for ', 'html5blank' ), $wp_query->found_posts ); echo get_search_query(); ?></h1>
<?php elseif(single_tag_title('', false)) : ?>
<h1><?php _e( 'Tag Archive: ', 'html5blank' ); echo single_tag_title('', false); ?></h1>
<?php else : ?>
<div class="blog-nav">
<ul>
<li class="channel <?php if(!$archive_category) print 'active' ?>">
<a href="/blog/">all</a>
</li>
<li class="channel technology <?php if($archive_category == 'Technology') print 'active' ?>">
<a href="/topics/channels/channel-technology/">technology</a>
</li>
<li class="channel policy <?php if($archive_category == 'Policy') print 'active' ?>">
<a href="/topics/channels/channel-policy/">policy</a>
</li>
<li class="channel investigations <?php if($archive_category == 'Investigations') print 'active' ?>">
<a href="/topics/channels/channel-investigations/">investigations</a>
</li>
</ul>
</div>
<?php endif ?>
<?php $has_sticky = false; $done = false;?>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<?php if(is_sticky($post->ID)): ?>
<?php $has_sticky = true; ?>
<div class="spotlight">
<h3 class="spotlight-title">Spotlight</h3>
<?php elseif($has_sticky && !$done): ?>
<?php $done = true; ?>
</div>
<?php endif ?>
<!-- article -->
<article id="post-<?php the_ID(); ?>" <?php post_class('hentry blog-post'); ?>>
<header>
<!-- post title -->
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h2>
<!-- /post title -->
<div class="meta">
<span class="author tip">
by <?php
if ( function_exists( 'coauthors_posts_links' ) ) {
coauthors_posts_links();
} else {
the_author_posts_link();
}
?>
</span>
<?php category_icons() ?>
<time datetime="<?php the_time('c'); ?> " class="published" pubdate="">
<?php the_time('M j, Y g:i a'); ?>
</time>
</div>
</header>
<div class="postContent">
<?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="feature-photo">
<?php the_post_thumbnail('thumbnail'); ?>
</a>
<?php endif; ?>
<div class="entry-summary ">
<?php html5wp_excerpt('html5wp_index'); ?>
<a class="more" href="<?php the_permalink(); ?>">Continue reading</a>
</div>
<div class="clear">
</div>
<footer class="summary-footer clear">
Share This: <?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>
</footer>
</article>
<!-- /article -->
<?php endwhile; ?>
<?php else: ?>
<!-- article -->
<article>
<h2><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h2>
</article>
<!-- /article -->
<?php endif; ?>
<?php get_template_part('pagination'); ?>
</section>
<!-- /section -->
</main>
<?php get_sidebar(); ?>
<?php get_footer(); ?>