• Resolved Poor Ridge

    (@poor-ridge)


    I’ve spent quite a few hours trying to figure this out. I have followed all sorts of comments on how to do it and I still haven’t been successful. URL is https://www.poorridgeranch.com/soap/

    All seems good except I don’t want the search box in the header.

    Thanks in advance! I don’t know where else to look!

    Terry

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Poor Ridge

    (@poor-ridge)

    figured it out, but now my top logo got shorter.

    try this^
    site-header .site-search {display: none;}
    .woocommerce-active .site-branding, .woocommerce-active .site-logo-anchor {display: none;}
    .woocommerce-active .site-header .secondary-navigation {
    display: none;}
    .boutique-primary-navigation {
    border-top-left-radius: 0.327em;
    border-top-right-radius: 0.327em;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 -0.53em rgba(0, 0, 0, 0.05) inset;
    margin: 9em -5.874em 0;
    padding: 0 5.874em;
    }

    Thread Starter Poor Ridge

    (@poor-ridge)

    I assume that should go in the style.css file? I tried it and it didn’t do anything if that’s where it was supposed to go. I also tried it in the storefront style.css and it didn’t work there either.

    try this:
    in /wp-content/themes/storefront/style.css
    line 697: .woocommerce-active .site-header .site-search {display: none;}
    line 693: .woocommerce-active .site-header .secondary-navigation {
    display: none;}

    in /wp-content/themes/storefront/inc/woocommerce/css/woocommerce.css
    look for .woocommerce-active .site-branding, .woocommerce-active .site-logo-anchorand mark it {display: none;}

    in /wp-content/themes/boutique/style.css
    line 278: change to:
    .boutique-primary-navigation {
    border-top-left-radius: 0.327em;
    border-top-right-radius: 0.327em;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 -0.53em rgba(0, 0, 0, 0.05) inset;
    margin: 9em -5.874em 0;
    padding: 0 5.874em;
    }

    don’t forget to make back-up before changing ))

    @poor-ridge hiding it using CSS is not best practice, so I suggest that you don’t follow the instructions above. Instead try using the code below to remove the search form.

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

    Because you’re using boutique which is already a child theme, I suggest that you install the my custom functions plugin so your custom code won’t be removed when you update your theme. If you don’t want to install additional plugins, you can simply add this code to your child theme’s functions.php. Hope this helps!

    Thanks, it helped for me too in my child of Storefront

    @wooassist tell please, how to remove site-branding and secondary-navigation. Same code is not working.

    i found…

    add_action( ‘init’, ‘woa_theme_init’ );
    function woa_theme_init() {

    remove_action( ‘storefront_header’, ‘storefront_product_search’, 40 );
    remove_action( ‘storefront_header’, ‘storefront_secondary_navigation’, 30 );
    remove_action( ‘storefront_header’, ‘storefront_site_branding’, 20 );
    }

    Thank you this is so helpful

    Hi all

    this action:

    add_action( ‘init’, ‘woa_theme_init’ );
    function woa_theme_init() {

    remove_action( ‘storefront_header’, ‘storefront_product_search’, 40 );
    remove_action( ‘storefront_header’, ‘storefront_secondary_navigation’, 30 );
    remove_action( ‘storefront_header’, ‘storefront_site_branding’, 20 );
    }

    does not work for me.

    any idea’?

    thx

    I have downloaded the plugin – My Custom Functions, entered the code that “wooassist” suggested. The plugin told me that “custom functions updated properly”

    The search box is still in the header and I can’t even find where the function was updated. I looked in the theme header and boutique area in the editor.

    I’m lost.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Using Boutique – how to remove search box in header’ is closed to new replies.