-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsearch.php
More file actions
86 lines (69 loc) · 3.7 KB
/
search.php
File metadata and controls
86 lines (69 loc) · 3.7 KB
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
<?php
/**
* Theme's Search
*
*
* @file search.php
* @package WordPress
* @subpackage Shell
* @author Emil Uzelac, nofearinc
* @copyright 2003 - 2012 ThemeID, 2013 DevWP
* @license license.txt
* @version Release: 1.0
* @filesource wp-content/themes/shell-lite/search.php
* @link http://codex.wordpress.org/Theme_Development#Search_Results_.28search.php.29
* @since available since Release 1.0
*/
?>
<?php get_header(); ?>
<div id="content" class="grid col-620">
<h6><?php _e('We found','shell');?>
<?php
$allsearch = new WP_Query( "s=$s&showposts=-1" );
$key = esc_html( $s, 1 );
$count = $allsearch->post_count;
_e( ' – ', 'shell' );
echo $count . ' ';
_e( 'articles for ', 'shell' );
_e( '<span class="post-search-terms">', 'shell' );
echo $key;
_e( '</span><!-- end of .post-search-terms -->', 'shell' );
wp_reset_query();
?>
</h6>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf( __( 'Permanent Link to %s', 'shell' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_title(); ?></a></h1>
<div class="post-meta">
<?php the_time( __( 'F jS, Y', 'shell' ) ) ?>
<?php the_author() ?>
</div><!-- end of .post-meta -->
<div class="post-entry">
<?php the_content( __( 'Read more »', 'shell' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="pagination">' . __( 'Pages:', 'shell'), 'after' => '</div><!-- end of .pagination -->' ) ); ?>
</div><!-- end of .post-entry -->
<div class="post-data">
<?php the_tags( __( 'Tagged with:', 'shell' ) . ' ', ', ', '<br />' ); ?>
<?php printf( __( 'Posted in %s', 'shell' ), get_the_category_list( ', ' ) ); ?> |
<?php edit_post_link( __( 'Edit', 'shell' ), '', ' | ' ); ?>
<?php comments_popup_link( __( 'No Comments »', 'shell' ), __( '1 Comment »', 'shell' ), __( '% Comments »', 'shell' ), '', __( 'Comments Closed', 'shell' ) ); ?>
</div><!-- end of .post-data -->
</div><!-- end of #post-<?php the_ID(); ?> -->
<?php comments_template( '', true ); ?>
<?php endwhile; ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div class="navigation">
<div class="previous"><?php next_posts_link( __( '‹ Older posts', 'shell' ) ); ?></div>
<div class="next"><?php previous_posts_link( __( 'Newer posts ›', 'shell' ) ); ?></div>
</div><!-- end of .navigation -->
<?php endif; ?>
<?php else : ?>
<h1 class="title-404"><?php _e( '404 — Fancy meeting you here!', 'shell' ); ?></h1>
<p><?php _e( 'Don\'t panic, we\'ll get through this together. Let\'s explore our options here.', 'shell' ); ?></p>
<h6><?php _e( 'You can return', 'shell' ); ?> <a href="<?php echo home_url(); ?>/" title="<?php esc_attr_e( 'home', 'shell' ); ?>"><?php _e( '⏎ Home', 'shell' ); ?></a> <?php _e( 'or search for the page you were looking for', 'shell' ); ?></h6>
<?php get_search_form(); ?>
<?php endif; ?>
</div><!-- end of #content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>