Move Search to Top Bar

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6366 Reply
    Amy
    Guest

    Hi there. I would like the site search to appear in the “top-bar” div. Is this possible? I do use a child theme but I am not very good at writing my own functions from scratch. Thank you!

    #6368
    Ron
    Keymaster

    You could try this code on your child-theme’s functions.php

    add_action( 'frontier_after_top_bar', 'ra_search_on_top' );
    
    function ra_search_on_top() {
    ?>
       <form id="top-bar-search" action="<?php echo home_url( '/' ); ?>" method="get" role="search" style="float: right;">
          <input type="search" name="s">
          <input type="submit" value="Search">
       </form>
    <?php
    }
    #6369
    Amy
    Guest

    That worked like a charm. Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Move Search to Top Bar
Your information: