Change Search No Results Found Page?

Hi Folks,
I’m using Posts for profiles of employees - the posts are assigned to the category “Directory” and when I search I filter on this category only. Works great.

The issue I’m having is when no results are found. The user is taken to a News Archive page! I’d rather take them to a custom search results page. How might I do this? I want this page to be different than the standard no results found page or at least change the message based on which search was used (standard or employee directory).

Gregg

Hello Gregg,

Thanks for writing in!

You can go to Cornerstone > Layout Builder and create a custom archive layout. You can then assign the layout to the Search Results page.

If you are not familiar with the Layout Builder and the conditions, please check this out:

Best Regards.

Hi @ruenel, thanks for the reply. I know the layout builder and have used it. The issues isn’t with the layout per se but delivering the correct message or taking the user to the correct page when no search results are found. The course of action needs to be determined by whether or not the user used the search within a category option or the standard sitewide search.

Hello Gregg,

In your custom Search layout, you can insert a Section dedicated to display when there are no results. You add a condition to the section element like this:

The user should not be taken to the blog index. Unless otherwise, you have installed a 3rd party plugin to override the default behavior of WordPress. Please provide us with your site URL so that we can inspect your search results page. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
- Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

Best Regards.

Secure note completed.

Search originates here: https://northlandedu.wpengine.com/about-northland/faculty-and-staff-directory/

Try a search for your name. The search URL will include the category ID: https://northlandedu.wpengine.com/?s=Ruenel&cat=297

At this point there is only one Search Layout - for the site search.

Hello Gregg,

The News archive is overriding the Search Result layout. You will need to add another condition for your News Archive layout:

Kindly let us know how it goes.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.