• Hi all,
    I’d like to remove the search box and have found the appropriate code in header.php and pasted it into Style.css in my Twenty Eleven child theme and added <!– ~~> around it. The search box disappears when I add this in the parent theme (only to test it) but when I paste this section of code into the Child Theme it doesn’t work. Am I missing something out?

    This is what it looks like in the Child Theme Style.css:

    @import url(“../twentyeleven/style.css”);

    <!– <?php get_search_form(); ?> –>
    </div>
    <?php
    else :
    ?>
    <!– <?php get_search_form(); ?> –>

    thanks, Susie

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think you are confusing a stylesheet (.css) with a PHP file (.php). In your child theme folder, you need to place a copy of the header.php file and edit that by commenting out the search form code. Commenting out in PHP or HTML uses <!– ??? –>. But commenting out in a stylesheet is /*…*/

    Also, PHP/HTML codes don’t belong in a stylesheet.

    I’m no expert, but I hope that helps!

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I’d like to remove the search box and have found the appropriate code in header.php

    Just to review give this a read. ??

    https://codex.www.ads-software.com/Child_Themes

    Make a child theme of Twenty Eleven (see that article), activate it, and then install and use Firebug to identify the CSS for the search box so that it can be hidden.

    Once identified, it’s not difficult to add the CSS to your child theme’s style.css to hide the search box in the header.

    Thread Starter SRCreative

    (@srcreative)

    Thanks Jan and typebee! I’ll install Firebug, sounds just what I need.
    One question, what’s the best way to access my child theme folder? Can I do this through WordPress?
    Thanks guys in advance,
    Susie

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    One question, what’s the best way to access my child theme folder?

    To each there own. Some use FTP (FileZilla), others use WinSCP, and then oddballs such as myself ssh to the server and use mkdir and vi to edit the files…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What code should be added in Style.css Child Theme’ is closed to new replies.