WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Eleven - removing the search box (8 posts)

  1. Karlene814
    Member
    Posted 1 year ago #

    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 http://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

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

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

  3. Karlene814
    Member
    Posted 1 year ago #

    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?

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    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;
  5. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Try adding this to the child theme style.css:

    #branding #searchform {
       display: none;
    }
  6. Karlene814
    Member
    Posted 1 year ago #

    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?

  7. agee
    Member
    Posted 1 year ago #

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

  8. Karlene814
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic