• Resolved FriskOKitty

    (@friskokitty)


    nothingsshocking.com
    WordPress Version: 3.4.1

    Yikes! I added a search bar to my floating menu, to the left of the content, and now the search bar appears in all the menu areas, above and below the header. I only want the search bar to appear in the left-hand side, floating menu. How do I remove the main and top menus? Thank you.

    This is the code I added to the functions.php:

    add_filter(‘wp_nav_menu_items’,’add_search_box’, 10, 2);
    function add_search_box($items, $args) {

    ob_start();
    get_search_form();
    $searchform = ob_get_contents();
    ob_end_clean();

    $items .= ‘

    • ‘ . $searchform . ‘
    • ‘;

      return $items;
      }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter FriskOKitty

    (@friskokitty)

    This is the code I added to the functions.php:

    add_filter(‘wp_nav_menu_items’,’add_search_box’, 10, 2);
    function add_search_box($items, $args) {

    ob_start();
    get_search_form();
    $searchform = ob_get_contents();
    ob_end_clean();

    $items .= ‘

    • ‘ . $searchform . ‘
    • ‘;

      return $items;
      }

    Thread Starter FriskOKitty

    (@friskokitty)

    Solved: I added:

    #topNav  { display: none; }
    #menu { display:none; }

    to the custom.css

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I remove the search bar from main and top menus?’ is closed to new replies.