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 :: shop manager Redirect @ WooCommerce 
Php :: PHP strspn — Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask 
Php :: laravel easy form 
Php :: php tableaux 
Php :: Accept multiple space separated inputs 
Php :: Target class [HomeController] does not exist. 
Php :: generateThumbnailRepresentations 
Php :: simple_html_dom stream does not support seeking 
Php :: import csv laravel 8 
Php :: php -phone number verification 
Php :: AAPL_041621C125@3.25SL2.00 
Php :: share var in a maser layout laravel 
Php :: mr deepfakes forum 
Php :: How to append json array using jq+shell in a loop 
Php :: how do istart writing a php code 
Php :: #@923uf8023hFO@I#H# 
Php :: add tag tpo protfolio? 
Php :: PHP stripslashes — Un-quotes a quoted string 
Php :: laravel create multiple rows 
Php :: php email 
Php :: codeigniter base url automatic 
Php :: laravel make migration 
Php :: how to print any string in double quotes in php 
Php :: Write a php program to swap two numbers using temporary variable 
Php :: recorrer un array php 
Php :: php hash list 
Java :: how to detect operating system in java 
Java :: import javax.validation.valid error 
Java :: create a random char java 
Java :: java jcombobox get selected item 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =