/
index.php
executable file
·87 lines (80 loc) · 3.7 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
<?php get_header(); ?>
<header class="collage short">
<div class="grid-2 square">
<h1 class="title-page">
<?php $post = $posts[0]; // Hack for the_date() functionality ?>
<?php if (is_home()) { ?><?php echo get_bloginfo('name');?>
<?php } elseif (is_category()) { ?><?php single_cat_title(); ?>
<?php } elseif( is_tag() ) { ?>Posts Tagged ‘<?php single_tag_title(); ?>’
<?php } elseif (is_day()) { ?><?php the_time('F jS, Y'); ?>
<?php } elseif (is_day()) { ?><?php the_time('F jS, Y'); ?>
<?php } elseif (is_month()) { ?><?php the_time('F, Y'); ?>
<?php } elseif (is_year()) { ?><?php the_time('Y'); ?>
<?php } elseif (is_author()) { ?>
<?php
if(get_query_var('author_name')) :
$curauth = get_user_by('slug', get_query_var('author_name'));
else :
$curauth = get_userdata(get_query_var('author'));
endif;
echo $curauth->display_name;
?>
<?php } else { ?><?php single_cat_title(); ?>
<?php } ?>
</h1>
<?php if (is_home()) { ?>
<h2 class="description-page">Notes on
<?php
$args = array( 'parent' => 0 );
$categories = get_categories( $args );
foreach ( $categories as $index => $category ) : ?>
<a class="monochrome" href="<?php echo get_category_link( $category->term_id ); ?>"><?php echo $category->name; ?></a><?php
$categoriesLength = count($categories);
if($index < $categoriesLength - 1) {
// draw a comma or and
if($index == $categoriesLength - 2) {
if ($categoriesLength == 2) {
echo " & ";
} else {
echo ", and ";
}
} else {
echo ", ";
}
}
?><?php endforeach; ?>.
</h2>
<?php } elseif (is_category()) { ?><h2 class="description-page"><?php $category=get_category($cat); echo $category->description; ?></h2>
<?php } elseif (is_author()) { ?><h2 class="description-page"><?php echo $curauth->description; ?><?php } ?></h2>
</div>
<div class="social">
<form action="https://percolatestudio.us3.list-manage.com/subscribe/post">
<input type="hidden" name="u" value="4eaab348037bea8afae9acd5f">
<input type="hidden" name="id" value="a118b8ae30">
<div class="input-symbol left">
<input name="EMAIL" type="email" size="20" value="" placeholder="Get the newsletter">
<span class="icon-email"></span>
</div>
<button type="submit" style="display:none;" name="subscribe" id="mc-embedded-subscribe"></button>
</form>
<a href="http://twitter.com/percolatestudio" class="monochrome" target="_blank"><span class="icon-twitter"></span></a>
<a href="http://github.com/percolatestudio" class="monochrome" target="_blank"><span class="icon-github"></span></a>
<a href="<?php bloginfo('url'); ?>/?feed=mailchimp" class="monochrome" target="_blank"><span class="icon-rss"></span></a>
</div>
</header>
<?php if (have_posts()) :
$i = 0;
?>
<div class="collage responsive">
<?php while (have_posts()) : the_post(); $i++; ?>
<?php if ($i == 1 or $i == 6 and $paged < 1) :?>
<?php include('snip_post_grid_large.php'); ?>
<?php else: ?>
<?php include('snip_post_grid.php'); ?>
<?php endif;?>
<?php endwhile; ?>
</div>
<div class="navigation"><?php dr_previous_posts_link('Previous', '', ''); ?><?php dr_next_posts_link('Next', '', ''); ?></div>
<?php else : ?>
<?php endif; ?>
<?php get_footer(); ?>