• Resolved barrelleaf

    (@barrelleaf)


    Hi there.

    I got some customization question again.

    I’ve created a child theme and made some changes. One thing I’ve struggling these few days is to move the search box to the top menu instead of on the sidebar. (between the current top menu and the social site-tool)

    I’ve thought about inserting the search HTML code <form action ….> to the menu; however, I found that the menu is called by

    <?php wp_nav_menu( array(
    	'theme_location' => 'main_menu',
    	'container'      => '',
    	'menu_id'        => '',
            'menu_class'     => 'navigation'
    					) ); ?>

    so I’m not sure how to make that customization.
    I’ve learned a little PHP but sure not so confident enough to make any changes.

    I’m wondering if there is an HTML file that I could directly add the search box code or how to make it happen.

    Thank you.

    Nora

    • This topic was modified 6 years ago by barrelleaf.
    • This topic was modified 6 years ago by barrelleaf.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Fotis

    (@markwaregr)

    Hi,
    in header.php add

    <?php get_search_form(); ?>
    

    before

    <?php if ( get_theme_mod( 'header_socials', 1 ) == 1 ) {
    									get_template_part( 'part-social-icons' );
    								} ?>

    Let me know if you need additional help on this.

    Thread Starter barrelleaf

    (@barrelleaf)

    Hi Fotis,

    Thank you for your simple and easy-to-understand answer.

    I made a little adjustment and use custom CSS to move the search box to the position that I want.

    Thank you again.
    I really appreciate this. ??

    Fotis

    (@markwaregr)

    Glad I could help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Move Search Box to the Top Menu’ is closed to new replies.