-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
85 lines (57 loc) · 2.48 KB
/
single.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
<?php get_header(); ?>
<nav class="subnav">
<label for="archive-dropdown">Archives</label>
<span>
<select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
<option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option>
<?php wp_get_archives( 'type=monthly&format=option&show_post_count=1' ); ?>
</select>
</span>
<label for="cat">Categories</label>
<span>
<?php wp_dropdown_categories(array('show_option_all' => 'All Shoots', 'show_count' => 1, 'class' => 'styled')); ?>
</span>
<script type="text/javascript"><!--
var dropdown = document.getElementById("cat");
function onCatChange() {
if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
location.href = "<?php echo get_option('home');
?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
}
}
dropdown.onchange = onCatChange;
--></script>
<?php get_search_form(); ?>
</nav>
<div class="content">
<section class="post ten columns offset-by-one">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article class="post">
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
<p class="date">Posted <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>
<?php if(get_the_tags()): ?>
in <?php the_tags('', ', '); ?>
<?php endif; ?>
</p>
<?php the_content(); ?>
</article>
<nav class="post-nav">
<?php
$previous_post = get_adjacent_post(false, '', true);
$next_post = get_adjacent_post(false, '', false);
if ($previous_post): ?>
<p class="prev"><span class="label">Previously</span><br><?php previous_post_link('%link', '%title', false, '92'); ?></a></p>
<?php endif; ?>
<?php if ($next_post): // if there are newer articles ?>
<p class="next"><span class="label">Next</span><br><?php next_post_link('%link', '%title', false, '92'); ?></p>
<?php endif; ?>
</nav>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<section id="comments">
<?php comments_template(); ?>
</section>
</section>
</div>
<?php get_footer(); ?>