Site logo

Archived topic

navigation search positioning

7 replies · Started by keiron on January 25, 2018

Viewing posts 1–8 of 8

is there any way to have the navigation search open below the navigation as opposed to across it? example being http://www.ohsheglows.com mobile version. at present i am using the snippet code tom has provided to change the placeholder name seen below...

if ( ! function_exists( 'generate_navigation_search' ) ) :

add_action( 'generate_inside_navigation','generate_navigation_search');
function generate_navigation_search()
{
$generate_settings = wp_parse_args(
get_option( 'generate_settings', array() ),
generate_get_defaults()
);

if ( 'enable' !== $generate_settings['nav_search'] )
return;

?>
<form method="get" class="search-form navigation-search" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<input type="search" placeholder="Search Recipes or Ingredients" class="search-field" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" title="<?php _ex( 'Search', 'label', 'generatepress' ); ?>">
</form>
<?php
}
endif;

Hi there,

Are you only wanting it on mobile version or desktop as well?

just for mobile

Thanks for the response! However I don't think you understood what I meant. I wanted the search bar to move below the navigation bar when you click the icon, similar to as seen on the mobile version of http://www.ohsheglows.com

That's what the code is supposed to do.

Can you link me to your site with the code added?

awesome it works! the text on iphone is getting lost. when you press the search, seems to be fine on other devices.... any idea? link to website now provided...... also when you search something then swipe back to the homepage the navigation logo splits from the search and toggle jumping above and floating right, this also happens when using the toggle links then swiping back as well...

This archived topic is closed to new replies.