Custom text when no search results returned

does this link below still provide the appropriate method for updating the text that appears on the page when no results are available upon doing a search?

I’m using Pro.

Site: https://tinyurl.com/ybgdv3kp

Screenshot:

Hello There,

Yes, the resolution provided in the thread still works to change the text. Because what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

Once you have your child theme active and ready, please follow the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?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( "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.", '__x__' ); ?></p>
    </div>
  </div>
</article> <!-- end #post-0 -->

3] Save the file named as _content-none.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/x-child/framework/views/global/ or wp-content/themes/pro-child/framework/views/global/ if you are using Pro theme.

You will have to create the folder path because it may not exist in your child theme yet.

Please let us know how it goes.

2 Likes

this appears to have worked. thanks!

On behalf of my colleague, you’re welcome. :slight_smile:

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