WordPress.org

Ready to get started?Download WordPress

Forums

add searchform.php into wp_nav_menu array (1 post)

  1. venkmanuk
    Member
    Posted 1 year ago #

    hi there,

    i'm trying to add a search form into a menu - ideally from a template part. trouble is if i do this, it doesn't pull anything in there:

    <?php wp_nav_menu( array(
    'theme_location' => 'primary',
    'before' => '<h3>',
    'after' => '</h3>',
    
    'items_wrap'  => '<ul id="%1$s" class="%2$s">%3$s<li class="responsiveSearch"><ul><li class="lisearch"><h3><a href="#" class="search">Search</a></h3><span><div class="box">' . get_template_part( 'element', 'searchbox' ) . '</div></span></li></ul> </li></ul>',
    
    ) ); ?>

    any ideas on how can this be done?
    thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic