I'm trying to make the search box background the same as the homepage, but for some reason there is a orange background - it doesn't use a different header.php its called within a filter the code below.

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 == 'main nav' )
        return $items."<li class='custom-search custom-search-gradient menu-item'><a href=\"javascript:void(0)\"><i class=\"icon-search\"></i>".__('Search', 'concept7')."</a><div class=\"menu-search-form\"><form style=\"overflow:hidden;text-align:center;\" method=\"get\" id=\"searchbar\" action=" .home_url()."/ >
                <input type=\"text\" class=\"menu-search-form-input\" name=\"s\" id=\"search\" value=\"Type and hit enter ...\"/>

    return $items;

This is the code that generates the search box, however I can't see anything in this that changes the background colour or a condition to say if its a certain page template change the background or div element.

Here is a link to the website, my desired result is to get the navigation to look the same as the homepage on all other pages - basically remove the orange background.

Many Thanks in advance.

  • 2
    You have CSS classes that take precedence in sub pages and makes the background orange. Its neither a PHP problem nor a WordPress.
    – M-R
    Jul 29 '13 at 16:01

Line 500 of your style.css reads:

.page-template-template-white-rev-php .custom-search .menu-search-form{

Just remove the background line here to fix it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.