Search
 
SCRIPT & CODE EXAMPLE
 

PHP

To Search Specific Post Type

function philosophy_search_form($form)
{
   $home_dir = home_url('/');
   $label = __('Search for:', 'philosophy');
   $btn_label = __('Search', 'philosophy');
   $search_form = <<<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="hidden" name="post_type" value="book">
      <input type="submit" class="search-submit" value="{$btn_label}">
   </form>
   FORM;

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

PREVIOUS NEXT
Code Example
Php :: Maximum precision of float in PHP 
Php :: php git pull webhook 
Php :: modal align center yii2 
Php :: php to python converter online free 
Php :: wc php free shipping function 
Php :: simple php round When a negative value is passed as a parameter 
Php :: How to Validate an Email Duplicate Entry in Codeigniter 
Php :: str_ireplace — Case-insensitive version 
Php :: Laravel - Controller get select value from Views 
Php :: stupidity 
Php :: envoyer mail php depuis localhost 
Php :: next previous post link 
Php :: function id codeigniter 3 
Php :: https://stackoverflow.com/questions/58589741/angular-8-hide-divs-and-show-div-on-button-click 
Php :: PHP quoted_printable_encode — Convert a 8 bit string to a quoted-printable string 
Php :: Yii2: Setting default values for all attributes of a model 
Php :: lazy loading vs eager loading laravel 
Php :: list.blade.php 
Php :: mkdir recursive php 
Php :: wordpress function _() not working 
Php :: laravel collection intersectKey 
Php :: laravel get previous route without domain 
Php :: laravel carbon subtract minutes to current time 
Php :: php Get location date format 
Php :: default time zone for europe php 
Php :: spatie sluggable not working 
Php :: array value auto fill in old value laravel 8 
Php :: laravel Difference between save, fill, create in laravel eloquent 
Php :: Yii::$app-session 
Php :: curl_setopt timeout php 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =