WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Twelve
[resolved] Float right search box in menu (3 posts)

  1. V0ld3m0rt
    Member
    Posted 1 year ago #

    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: http://tomasrydel.cz

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

    Functions.php:

    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.]

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

  2. paulwpxp
    Font hero
    Posted 1 year ago #

    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
    http://codex.wordpress.org/Child_Themes

    After you got that fixed, add this it

    @media screen and (min-width: 600px) {
    	li.menusearch { margin: 0; padding-top: 6px; float: right; }
    }
  3. V0ld3m0rt
    Member
    Posted 1 year ago #

    It works, thanks for quick respond Paul.

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

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic