Created
February 4, 2016 05:24
-
-
Save farookibrahim/a62d1922b4b5375fc4c2 to your computer and use it in GitHub Desktop.
Replace Search bar for Nav links in Bethlehem Header 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use init to perform remove_action on child theme | |
| add_action( 'init', 'bethlehem_child_init', 10 ); | |
| function bethlehem_child_init() { | |
| // remove nav links on header | |
| remove_action( 'bethlehem_header_3_nav_bar', 'bethlehem_navigation_links', 20 ); | |
| } | |
| // To add search block | |
| add_action( 'bethlehem_header_3_nav_bar', 'custom_header_search_block', 20 ); | |
| function custom_header_search_block() { | |
| ?> | |
| <div class="header-search-area"> | |
| <form method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>"> | |
| <div class="input-group"> | |
| <label class="sr-only screen-reader-text" for="search"><?php echo esc_html__( 'Search for:', 'bethlehem' );?></label> | |
| <input type="text" id="search" class="search-field" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" placeholder="<?php echo esc_attr( esc_html__( 'Search', 'bethlehem' ) ); ?>" /> | |
| <button type="submit"><i class="fa fa-search"></i></button> | |
| </div> | |
| </form> | |
| </div> | |
| <?php | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment