-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
75 lines (64 loc) · 1.97 KB
/
archive.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
<?php
// HEADER
if(!isajax()){
get_header(); // <div id="column2"> is in header
}
echo '<div class="view" data-context="index">';
if (have_posts()) {
$post = $posts[0]; // Hack. Set $post so that the_date() works.
$authordata = get_userdata($post->post_author);
$author = $authordata->user_nicename;
$nb_posts_found = $wp_query->found_posts; ?>
<!-- TEMPLATE ARCHIVE.PHP (search with tag) -->
<div class="result">
<h2 class="pagetitle">
<span>
<?php echo $nb_posts_found; ?>
<?php
if (is_category()) {
echo "Archive for the ‘".single_cat_title()."’ Category";
}
elseif( is_tag() ) {
echo "Mixtapes with artist ‘";
echo single_tag_title();
echo "’";
}
elseif (is_day()) {
echo "Archive for" .the_time('F jS, Y');
}
elseif (is_month()) {
echo "Archive for". the_time('F, Y');
}
elseif (is_year()) {
echo "Archive for" . the_time('Y');
}
elseif (is_author()) {
echo "mixes by " . $author;
}
elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
echo "Blog Archives";
} ?>
</span>
</h2>
<?php
while (have_posts()) {
the_post();
// THE POST : title, image, playlist, player, etc.
include("the_post.php");
}
// NAVIGATION
// if(!isajax()){
include("navigation.php");
// }
echo "</div><!-- .result -->";
}
else { // NO POSTS FOUND
echo '<h2 class="center">Not Found</h2>';
include (TEMPLATEPATH . '/searchform.php');
}
echo '</div>';
// SIDEBAR
if(!isajax()){
get_sidebar();
}
?>