/
index.php
executable file
·66 lines (61 loc) · 3.3 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
<?php get_header(); ?>
<div class="grid_9">
<?php if (is_category()) { ?>
<h1 class="title"><?php single_cat_title() ?></h1>
<?php } elseif (is_tag()) { ?>
<h1 class="title">Posts tagged with “<?php single_tag_title() ?>”</h1>
<?php } elseif (is_day()) { ?>
<h1 class="title"><?php the_time(get_option('date_format')); ?></h1>
<?php } elseif (is_month()) { ?>
<h1 class="title"><?php the_time("F Y") ?></h1>
<?php } elseif (is_year()) { ?>
<h1 class="title"><?php the_time("Y") ?></h1>
<?php } elseif (is_author()) {
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); ?>
<h1 class="title">Posts by <?php echo $curauth->display_name; ?></h1>
<style>header address { display: none; }</style>
<?php } elseif (is_search()) { ?>
<h1 class="title">Search results for “<?php the_search_query(); ?>”</h1>
<?php global $wp_query;
$total_results = $wp_query->found_posts;
if ($total_results == 0) { ?>
<p>Uh-oh... There's no results. :(</p>
<?php }} else {?>
<style>article header a.title { font-size: 39px; line-height: 48px; }</style>
<?php } ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<article class="teaser">
<header>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" class="title"><?php the_title(); ?></a>
<address>
<?php echo get_avatar( get_the_author_meta("user_email"), "48", "" ); ?>
<div>Written by: <?php the_author_posts_link(); ?></div>
</address>
<time><?php the_time(get_option('date_format')); ?></time>
</header>
<?php the_content(""); ?>
<footer>
<ul>
<li>Categories: <?php the_category(', '); ?></li>
<li><?php the_tags(); ?></li><li></li>
<li><a href="<?php echo get_permalink(); ?>#comments"><?php comments_number(); ?></a></li>
<?php wp_link_pages( array(
'before' => '<li>' . __('Pages:'),
'after' => '</li>'
)); ?>
<li><?php edit_post_link("Edit"); ?></li>
<li><a href="<?php the_permalink(); ?>">Read more</a></li>
</ul>
</footer>
</article>
<?php endwhile; ?>
<?php endif; ?>
<footer>
<ul>
<li><?php previous_posts_link('« Newer Entries'); ?></li>
<li><?php next_posts_link('Older Entries »'); ?></li>
</ul>
</footer>
</div>
<?php get_footer(); ?>