Hide Widgets in search archive

asked Jun 7, 2016 in Wordpress Themes by o-kosmol (140 points)
Hi there. Here I come with another question.

I am able to hide or show my widget areas on different pages or types of pages.

But how can I remove them for the site which shows up, when someone searches for something on my site? I wasn't able to find it in the search.php or searchform.php.

Thanks a lot

1 Answer

answered Jun 8, 2016 by lisa-west (19,500 points)
Hi,

TemplateToaster provide option to hide widget on specific page, go to Wordpress Admin -> Widgets ->  Select your widgrt Position -> Drag and drop any widget -> Hide Widget On:-> Save
commented Jun 8, 2016 by o-kosmol (140 points)
Yeah. Thats what I know and what I described in the 2nd line.

But it's not possible for the site which shows up, when someone usese my searchform.

But I solved the problem by myself.

Just add
    if ( ! is_search())
in the header.php to the widget area you would like to hide on searchform.

In my case its.

<div class="menubelowcolumn1">
<?php
    if ( ! is_search()){
...
}
Anyone interested in localization of TemplateToaster v7 in exchange of a Pro License Contact Us
...