Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Custom search form

function philosophy_search_form($form)
{
   $home_dir = home_url('/');
   $label = __('Search For:', 'philosophy');
   $btn_label = __('Search:', 'philosophy');
   $newform = <<<FORM
      <form role="search" method="get" class="header__search-form" action="{$home_dir}">
         <label>
            <span class="hide-content">{$label}</span>
            <input type="search" class="search-field" placeholder="Type Keywords" value="" name="s" title="{$label}" autocomplete="off">
         </label>
         <input type="submit" class="search-submit" value="{$btn_label}">
      </form>
   FORM;

   return $newform;
}
add_filter('get_search_form', 'philosophy_search_form');
Comment

Custom searchform

<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
    <label>
        <span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ) ?></span>
        <input type="search" class="search-field"
            placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder' ) ?>"
            value="<?php echo get_search_query() ?>" name="s"
            title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
    </label>
    <input type="submit" class="search-submit"
        value="<?php echo esc_attr_x( 'Search', 'submit button' ) ?>" />
</form>
Comment

PREVIOUS NEXT
Code Example
Php :: palindrom number in php 
Php :: permission for multisite in wp-config.php file 
Php :: include vendor/autoload.php 
Php :: php artisan vendor:publish --provider="SpatieActivitylogActivitylogServiceProvider" --tag="activitylog-migrations" 
Php :: PHP create array of specified size 
Php :: PHP metaphone — Calculate the metaphone key of a string 
Php :: IgasterLaravel ThemeExceptions heme Already Exists 
Php :: facetwp listing template archive 
Php :: add line in string column export php 
Php :: Wordpress even odd post count 
Php :: laravel create multiple request 
Php :: wordpress php 
Php :: registerd navigations file uploadid 
Php :: if order has product id in array 
Php :: how to use pg_dropcluster 
Php :: get git branch with php 
Php :: command working in terminal but working from code php 
Php :: enhanced ecommerce data layer for woocommerce 
Php :: how to duplicate a database in phpmyadmin 
Php :: livewire mount return type 
Php :: import data from csv laravel 
Php :: Unregistering a variable with $_SESSION. 
Php :: php run python script with arguments json 
Php :: connecting to database and performing sql queries 
Php :: how to prevent iframe for your site by PHP 
Php :: WooCommerce quantity field to ajax add to cart button archive page 
Php :: file_get_contents vs readfile speed 
Php :: login with google account using php source code download 
Php :: leaf php response json 
Php :: php encrypt decrypt online 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =