-
Notifications
You must be signed in to change notification settings - Fork 13
/
search.php
52 lines (39 loc) · 1.9 KB
/
search.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
<?php get_header(); ?>
<?php if (have_posts()) : ?>
<h1>Search results for “<?php echo $s; ?>”</h1>
<?php while (have_posts()) : the_post(); ?>
<section id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header>
<h1><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
<p>by <?php the_author(); ?> on <?php the_time('F j, Y') ?></p>
</header>
<section>
<?php the_excerpt(); ?>
</section>
<footer>
<ul>
<li><?php comments_popup_link('Leave your comment', 'One comment', '% comments'); ?><?php the_tags(' • Tagged as: ', ', ', ''); ?></li>
<li>Share on <a href="http://twitter.com/home?status=Currently reading: <?php the_title_attribute(); ?> <?php the_permalink(); ?>">Twitter</a>, <a href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>&t=<?php the_title_attribute(); ?>">Facebook</a>, <a href="http://del.icio.us/post?v=4;url=<?php the_permalink(); ?>">Delicious</a>, <a href="http://digg.com/submit?url=<?php the_permalink(); ?>">Digg</a>, <a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title_attribute(); ?>">Reddit</a></li>
<?php edit_post_link('Edit this post', '<li>', '</li>'); ?>
</ul>
</footer>
</section>
<?php endwhile; ?>
<?php if (show_posts_nav()) : ?>
<nav>
<ul>
<li><?php next_posts_link('« Previous page') ?></li>
<li><?php previous_posts_link('Next page »') ?></li>
</ul>
</nav>
<?php endif; ?>
<?php else : ?>
<h1>Nothing found for “<?php echo $s; ?>”</h1>
<?php get_search_form(); ?>
<script type="text/javascript">
// Focus the search field.
$(function(){document.getElementById('s') && document.getElementById('s').focus();});
</script>
<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>