Snippets Collections
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');
star

Sat May 14 2022 10:33:53 GMT+0000 (Coordinated Universal Time)

#search #post_type

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension