Search form outside of menu items

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #5173 Reply
    Ron
    Keymaster

    Turn off the default menu search form on the options page then add the code below on a child-theme’s functions.php

    function ra_search_on_nav() {
    ?>
       <form id="nav-search-form" class="right" action="<?php echo home_url( '/' ); ?>" method="get" role="search">
          <label><input type="search" name="s"></label>
          <input type="submit" value="">
       </form>
    <?php
    }
    add_action( 'ast_hook_after_nav', 'ra_search_on_nav' );
Viewing 1 post (of 1 total)
Reply To: Search form outside of menu items
Your information: