Last active
April 14, 2020 07:05
-
-
Save generatepress/c7436fb9e326586822a2fcd81e0d480e to your computer and use it in GitHub Desktop.
Add a placeholder to the navigation search
This file contains 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
add_action( 'after_setup_theme','tu_change_nav_placeholder' ); | |
function tu_change_nav_placeholder() | |
{ | |
remove_action( 'generate_inside_navigation','generate_navigation_search'); | |
add_action( 'generate_inside_navigation','tu_navigation_search', 5 ); | |
} | |
function tu_navigation_search() | |
{ | |
if ( function_exists( 'generate_get_setting' ) && 'enable' !== generate_get_setting( 'nav_search' ) ) | |
return; | |
?> | |
<form method="get" class="search-form navigation-search" action="<?php echo esc_url( home_url( '/' ) ); ?>"> | |
<input type="search" placeholder="YOUR PLACEHOLDER HERE" class="search-field" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" title="<?php _ex( 'Search', 'label', 'generatepress' ); ?>"> | |
</form> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment