Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 57b5c24c9b
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (30 sloc) 1.011 kB
<?php
/**
* Search Form Template
*
* The search form template displays the search form.
*
* @package Cakifo
* @subpackage Template
*/
?>
<?php
/**
* Set the value on the search input
*/
if ( is_search() )
$value = 'value="' . esc_attr( get_search_query() ) . '"'; // Search query for the search page
elseif ( is_404() )
$value = 'value="' . esc_attr( basename($_SERVER['REQUEST_URI']) ) . '"'; // Requested URI for 404 page
else
$value = 'placeholder="' . esc_attr__( 'Search', 'cakifo' ) . '"'; // Or "Search" as placeholder
?>
<div class="search">
<form method="get" class="search-form" action="<?php echo trailingslashit( home_url() ); ?>" role="search">
<label>
<span class="assistive-text"><?php _e( 'Search', 'cakifo' ); ?></span>
<input class="search-text" type="search" name="s" <?php echo $value; ?> />
</label>
<input class="search-submit" type="submit" value="<?php esc_attr_e( 'Search', 'cakifo' ); ?>" />
</form> <!-- .search-form -->
</div> <!-- .search -->
Jump to Line
Something went wrong with that request. Please try again.