• Hi,
    I’m using the twenty eleven theme. Made a child theme, to make changes in the some of the style. One thing I’d like to do is remove the search box for on the header of the template. I’m getting used to to using firebug – I can see the code that is being used, but I’m not sure what to put on the style.css in my child theme.
    This site is https://www.bethelysleboda.com
    Appreciate any help, also any suggestions on tutorials etc how to use firebug more to help me out as there are other changes I need to make.
    Thanks, Karlene

Viewing 7 replies - 1 through 7 (of 7 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Look at how to implement CSS display: none;
    with the firebug selectors you’ve found.

    Thread Starter Karlene814

    (@karlene814)

    if I understand you right
    this is what I find

    #branding .only-search #s, #branding .only-search #s:focus {
        width:85%;
    }

    so I would add this line to my childtheme style.css
    {display:none} after the previous lines?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    At the bottom of your childtheme style.css file, you need to combine the selectors you found from firebug,

    #branding .only-search #s, #branding .only-search #s:focus

    with the CSS style

    display: none;

    Try adding this to the child theme style.css:

    #branding #searchform {
       display: none;
    }
    Thread Starter Karlene814

    (@karlene814)

    Thank you both for your help! The search bar is now gone but it appears that the space that was taken up by the box itself is still taking up the real estate – thus making my menu overflow. Any additional code I should add?

    And any good tutorials (sounds like I need to understand selectors) for someone that doenst know CSS too well so I can plow my way thru doing this?

    commenting out the following from the header.php for 2011 worked like a charm for me.

    <!--
    <?php
    // Has the text been hidden?
    if ( 'blank' == get_header_textcolor() ) :
    ?>
    <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
    <?php get_search_form(); ?>
    </div>
    <?php
    else :?>
    <?php get_search_form(); ?>
    <?php endif; ?>
    -->

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]

    Thread Starter Karlene814

    (@karlene814)

    Agee – Thanks but I really want to do modifications in child theme format.
    Andrew – just another clarification. Every selector I see for the search bar – correct? There are more than what you lited. And can they be listed as you did above? Then add the display none?
    I tried what you put – like I said the search bar is gone but my menu bar runneth over – I have removed a menu item as a quick fix, but I do need to add it back in.
    Thanks again for your help – much appreciation!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Twenty Eleven – removing the search box’ is closed to new replies.