1

How can I remove the search window? I have searched and tried everything to no avail. The theme I'm using is BlankSlate.

enter image description here

The search window (top-right) doesn't appear when logged-out, but I'd still like to get rid of it if I can.

I searched through all the files in the theme for the word "search" and tried removing that command from entry.php and entry-summary.php. None of that had an effect. I also tried removing the search.php file, that had no effect. I also tried adding:

form.search-form { display: none; }

Into the style.css page. Also no change.

2
  • Please elaborate your question providing screenshots, references, and what you've tried. Commented Jan 31, 2017 at 18:52
  • Here's screen shot of the index page so far, ('test', 'new studio' are posts). ericwestfall.com/screenshot.png. The search window (top-right) doesn't appear when logged-out, but I'd still like to get rid of it if I can. I searched through all the files in the theme for the word "search" and tried removing that command from entry.php and entry-summary.php. None of that had an effect. I also tried removing the search.php file, that had no effect. I also tried adding form.search-form { display: none; } into the style.css page, also no change. Thanks in advance for any help!
    – Eric
    Commented Jan 31, 2017 at 23:07

1 Answer 1

1

I searched through all the files in the theme for the word "search" and tried removing that command from entry.php and entry-summary.php. None of that had an effect. I also tried removing the search.php file, that had no effect.

To save you grief, any edits to the core files provided by WordPress will potentially break your website if you modify it incorrectly. Also with each new update provided by WordPress, it will overwrite and re-add the files to their default/updated state.

To hide the search, add the following to your child theme's function.php:

add_action( 'wp_before_admin_bar_render', 'wpse_254662_toolbar', 10, 1 );

function wpse_254662_toolbar() {
    # Hide search from admin toolbar
    global $wp_admin_bar;
    $wp_admin_bar -> remove_menu( 'search' );
}
1
  • @Eric Glad that solved your issue. Please click the checkmark next to my answer to indicate that this question has been solved. Commented Feb 1, 2017 at 3:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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