Modify Message When Search Produces No Results

We want to modify the message seen when someone searches for something on our site and the search results doesn’t have any search results. I searched the forum and reviewed the numerous previous other inquiries on this topic.

This thread appeared most relevant.

https://theme.co/apex/forum/t/nothing-to-show-right-now-template-and-header/61669/3

Its for Pro, while we use Theme X, Cornerstone (latest versions) and a child theme.
Using a backup of our dev site, I did find the file mentioned. _content-none.php

I followed the directions and uploaded a modified version of _content-none.php. The modification I made was to replace the message, “It appears whatever you were looking for is no longer here or perhaps wasn’t here to begin with. You might want to try starting over from the homepage to see if you can find what you’re after from there.”

With this, “Not finding what you are looking for? Need help? You can either try your search again OR have one of our MiTeGen support representatives look up the product for you. Visit our product look up request form and let us find that product for you.”

When I searched for something I knew was not on our site, the search results page returned a message indicating “The site is experiencing technical difficulties.”

See https://devawpny.wpengine.com/?s=flower

Is it possible to include that html code within the _content-none.php? Searching Google I do see its mentioned that if html code is going to be placed within PHP, special steps are needed. See https://www.thoughtco.com/php-with-html-2693952

Or is there another modification I need to make?

Thanks
Tim

Hello Tim,

Thank you for the very detailed post information. Did you already have edited the _content-none.php file? It seems that there is a fatal error on that page. Please provide us access to your site so that we can check your code in the file. Please create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Thanks.

@RueNel -

Yes I created the edited version of _content-none.php and uploaded it to the child theme area as mentioned in the instructions. I’ve also sent the secure note.

Thanks
Tim

Hello Tim,

I have resolved your issue. There was a problem with the quotes in one of the codes. I used this one:

<?php

// =============================================================================
// VIEWS/GLOBAL/_CONTENT-NONE.PHP
// -----------------------------------------------------------------------------
// Output when no posts or pages are available.
// =============================================================================

?>

<article id="post-0" class="post-0 post type-post status-publish hentry">
  <div class="entry-wrap">
    <header class="entry-header">
      <h1 class="entry-title"><?php _e( 'Nothing to Show Right Now', '__x__' ); ?></h1>
    </header>
    <div class="entry-content">
      <p><?php _e( 'Not finding what you are looking for? Need help? You can either try your search again OR have one of our MiTeGen support representatives look up the product for you. Visit our <a href="https://www.mitegen.com/learn/about-mitegen/contact-us/">product look up request form</a> and let us find that product for you.', '__x__' ); ?></p>
    </div>
  </div>
</article> <!-- end #post-0 -->

Check your site now.

1 Like

@RueNel - Thank you. Its working now.

Tim

You’re welcome!

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