Support » Theme: Twenty Twelve » Float right search box in menu

  • Resolved V0ld3m0rt


    I am trying to move search box to the right. But there is still space and I don’t know, how to move it, I am noob I know. Here is my site:

    Here is what I put into functions.php and css.


    add_filter('wp_nav_menu_items','add_search_box_to_menu', 10, 2);
    function add_search_box_to_menu( $items, $args ) {
        if( $args->theme_location == 'primary' )
            return $items."<li class='menusearch'>
    		<form action='/' id='searchform' method='get'>
    		<input type='text' name='s' id='s' placeholder='Hledat'>
    		<input type='submit'  id='searchsubmit' value='Hledat'> </form>";
        return $items;

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    .menusearch { float:right; padding-top:4px;}

Viewing 2 replies - 1 through 2 (of 2 total)
  • You got a duplicate set of parent’s style in your child theme style.css.

    You shoud only have that first block of comment at the top and then the @import line and then nothing else from the parent’s style.css, below that only declare, re-declare what you want to override.

    Review this again and compare to yours

    After you got that fixed, add this it

    @media screen and (min-width: 600px) {
    	li.menusearch { margin: 0; padding-top: 6px; float: right; }

    It works, thanks for quick respond Paul.

    The problem was I duplicated style.css in child theme. I am smarter now 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Float right search box in menu’ is closed to new replies.