How do I target a query in an Elements template?

I created a unique template with a two-column container: the first column for my filters and the second for displaying the page’s products.

In the second part (product display), I placed a query loop.

The filters act directly on the loop; there are no problems.

I placed this template in the WooCommerce product archive and brand archive templates, and everything works normally. However, I placed this template in the product search template.

In the product search template, I created a section with a container and a search bar, but I can’t target my product loop… How can I work around this problem?

I could avoid using my template altogether and copy its content to paste into the search template, but if I modify the filters or the style, I would have to manually recreate it each time for the search template…


To work around this problem, the only way to do it for now is to add the section with the search bar to my template and create a condition that only displays it on the search results page.

But is hiding content a good practice?
Won’t this have any negative impact on SEO?