Search results template. How to call it correctly?

This is my custom template visibility settings. Show for products list, but not for the search results.

For another template I set these settings. This template should be used for the search results. But it’s not.

As a result I get a blank page for the search query “?s=black&post_type=product”. What am I doing wrong? Why is my search template not loaded? How to correctly set template visibility conditions for custom posts search results? I’m confused with visibility settings configuration and need an explanation there. :frowning:

The first test I recommend is to set a higher priority.

If that doesn’t work, secondly I would check what happens if you disable the visibility conditions entirely.

The third test I would do, if you didn’t already set things up this way, is to

  1. Create a new template using the + Default button,
  2. Click the Add New button and choose “Search”.
  3. Then copy your existing search template to this new template (and delete the old one)
1 Like
  1. Priority didn’t have any impact.

  2. If conditions are ignored, the query “?s=black&post_type=product” search template is ignored too. In such case archive template + page data assigned as “Shop page” are loaded.

  3. It’s not possible to delete some default templates once they are created. Also, some problems arise when default templates are used. Switching everything to custom templates works the best, and it worked in this case. I’ll put the problem I hit into the Bugs section.