• Resolved robmines

    (@robmines)


    Need to remove the search bar from the header, currently using 4.0.1 and running storefront by woothemes.

    Thanks,

    Rob

Viewing 4 replies - 1 through 4 (of 4 total)
  • In your child themes functions.php file add:

    add_action( 'init', 'jk_remove_storefront_header_search' );
    function jk_remove_storefront_header_search() {
    remove_action( 'storefront_header', 'storefront_product_search', 	40 );
    }

    Our Storefront WooCommerce Customiser extension enables you to do this (and much more) without touching any code.

    Thanks.

    Thread Starter robmines

    (@robmines)

    Thank you!

    Hi,

    Thanks for the code james, but i thought, i have a mistake.

    the space between my logo and the menu is really close..

    please take a look this my screenshoot

    View post on imgur.com

    is there anyway to make it more space for it?

    When I add the above code in my child themed function.php my header height is reduced clipping logo and everything else at the top of the header. I have tried placing it before my footer code but still have the same results.

    <?php
    // Exit if accessed directly
    if ( !defined( ‘ABSPATH’ ) ) exit;

    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED – Do not modify or remove comment markers above or below:

    if ( !function_exists( ‘chld_thm_cfg_parent_css’ ) ):
    function chld_thm_cfg_parent_css() {
    wp_enqueue_style( ‘chld_thm_cfg_parent’, trailingslashit( get_template_directory_uri() ) . ‘style.css’ );
    }
    endif;
    add_action( ‘wp_enqueue_scripts’, ‘chld_thm_cfg_parent_css’ );

    // END ENQUEUE PARENT ACTION

    add_action( ‘init’, ‘custom_remove_footer_credit’, 10 );

    function custom_remove_footer_credit () {
    remove_action( ‘storefront_footer’, ‘storefront_credit’, 20 );
    add_action( ‘storefront_footer’, ‘custom_storefront_credit’, 20 );
    }

    function custom_storefront_credit() {
    ?>
    <div class=”site-info”>
    © <?php echo get_bloginfo( ‘name’ ) . ‘EDFM LLC ‘ . get_the_date( ‘Y’ ); ?>
    </div><!– .site-info –>
    <?php
    }

    add_action( ‘init’, ‘jk_remove_storefront_header_search’ );
    function jk_remove_storefront_header_search() {
    remove_action( ‘storefront_header’, ‘storefront_product_search’, 40 );
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove Search Bar from heaser’ is closed to new replies.