get_search_form from technosailor. fixes #7910
git-svn-id: https://develop.svn.wordpress.org/trunk@9234 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
202c2fc0be
commit
5413ecde13
@ -63,7 +63,7 @@ get_header();
|
|||||||
printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", get_userdatabylogin(get_query_var('author_name'))->display_name);
|
printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", get_userdatabylogin(get_query_var('author_name'))->display_name);
|
||||||
else
|
else
|
||||||
echo("<h2 class='center'>No posts found.</h2>");
|
echo("<h2 class='center'>No posts found.</h2>");
|
||||||
include (TEMPLATEPATH . '/searchform.php');
|
get_search_form();
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
|
@ -12,7 +12,7 @@ Template Name: Archives
|
|||||||
|
|
||||||
<div id="content" class="widecolumn">
|
<div id="content" class="widecolumn">
|
||||||
|
|
||||||
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
|
<?php get_search_form(); ?>
|
||||||
|
|
||||||
<h2>Archives by Month:</h2>
|
<h2>Archives by Month:</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -34,7 +34,7 @@ get_header(); ?>
|
|||||||
|
|
||||||
<h2 class="center">Not Found</h2>
|
<h2 class="center">Not Found</h2>
|
||||||
<p class="center">Sorry, but you are looking for something that isn't here.</p>
|
<p class="center">Sorry, but you are looking for something that isn't here.</p>
|
||||||
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
|
<?php get_search_form(); ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ get_header(); ?>
|
|||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
|
|
||||||
<h2 class="center">No posts found. Try a different search?</h2>
|
<h2 class="center">No posts found. Try a different search?</h2>
|
||||||
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
|
<?php get_search_form(); ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package WordPress
|
|
||||||
* @subpackage Default_Theme
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
|
|
||||||
<label class="hidden" for="s"><?php _e('Search for:'); ?></label>
|
|
||||||
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
|
|
||||||
<input type="submit" id="searchsubmit" value="Search" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
@ -9,7 +9,7 @@
|
|||||||
<?php /* Widgetized sidebar, if you have the plugin installed. */
|
<?php /* Widgetized sidebar, if you have the plugin installed. */
|
||||||
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
|
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
|
||||||
<li>
|
<li>
|
||||||
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
|
<?php get_search_form(); ?>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
|
<!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
|
||||||
|
@ -93,6 +93,22 @@ function get_sidebar( $name = null ) {
|
|||||||
load_template( get_theme_root() . '/default/sidebar.php');
|
load_template( get_theme_root() . '/default/sidebar.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_search_form() {
|
||||||
|
do_action( 'get_search_form' );
|
||||||
|
|
||||||
|
if ( '' != locate_template(array('searchform.php'), true) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
$form = '<form method="get" id="searchform" action="' . get_option('siteurl') . '/" >
|
||||||
|
<label class="hidden" for="s">' . __('Search for:') . '</label>
|
||||||
|
<div><input type="text" value="' . the_search_query() . '" name="s" id="s" />
|
||||||
|
<input type="submit" id="searchsubmit" value="Search" />
|
||||||
|
</div>
|
||||||
|
</form>';
|
||||||
|
|
||||||
|
echo apply_filters('get_search_form', $form);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the Log In/Out link.
|
* Display the Log In/Out link.
|
||||||
*
|
*
|
||||||
|
@ -763,20 +763,10 @@ function wp_widget_links($args) {
|
|||||||
*/
|
*/
|
||||||
function wp_widget_search($args) {
|
function wp_widget_search($args) {
|
||||||
extract($args);
|
extract($args);
|
||||||
$searchform_template = get_template_directory() . '/searchform.php';
|
|
||||||
|
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
|
|
||||||
// Use current theme search form if it exists
|
// Use current theme search form if it exists
|
||||||
if ( file_exists($searchform_template) ) {
|
get_search_form();
|
||||||
include_once($searchform_template);
|
|
||||||
} else { ?>
|
|
||||||
<form id="searchform" method="get" action="<?php bloginfo('url'); ?>/"><div>
|
|
||||||
<label class="hidden" for="s"><?php _e('Search for:'); ?></label>
|
|
||||||
<input type="text" name="s" id="s" size="15" value="<?php the_search_query(); ?>" />
|
|
||||||
<input type="submit" value="<?php echo attribute_escape(__('Search')); ?>" />
|
|
||||||
</div></form>
|
|
||||||
<?php }
|
|
||||||
|
|
||||||
echo $after_widget;
|
echo $after_widget;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user