How to: Add right aligned search box to main navigation

  • Author
    Posts
  • #33197
    sonix

    I know how to generally add a search box to the main menu (used code added):

    add_filter(‘wp_nav_menu_items’,’add_search_box_to_nav_menu’, 10, 2);
    function add_search_box_to_nav_menu( $items, $args ) {
    if( $args->theme_location == ‘primary’ )
    return $items.get_search_form();

    return $items;
    }
    `
    But I’m not able to modify the style.css, so that the box is aligned left.
    Could anyone please help me?

    Many thanks 🙂

    sonix

Viewing 1 post (of 1 total)

The topic ‘How to: Add right aligned search box to main navigation’ is closed to new replies.