How to change the search result message, if nothing is found

Hi everyone,
I found another topic about that here:


The link suggesting a solution is from the old forum and quite old now.
Is there a way to do that besides creating a child-theme by now?

Regards
Ralf

Hi Ralf,

Thank you for reaching out to us. This requires a template change therefore you need to setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

After setting up your child theme, create a new file and name it _content-none.php. Open the file and paste the following code inside:

<?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( 'The Title', '__x__' ); ?></h1>
    </header>
    <div class="entry-content">
      <p><?php _e( "The Text", '__x__' ); ?></p>
    </div>
  </div>
</article> <!-- end #post-0 -->

In the above code change the The Title with your custom title and change The Text with actual content. Now save the file and via FTP upload the file to /x-child/framework/views/global/ directory in your child theme. Create the folders if you don’t see them in your child theme to have an exact path /x-child/framework/views/global/

Hope this helps!

1 Like

Hi Ralf,

Thanks for writing in! That template is still there under /wp-content/themes/x/framework/views/global/_content-none.php. First you need to setup a child theme and activate it by following this guide here (https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57).

Then copy the above template file into your child theme’s respective location /wp-content/themes/x-child/framework/views/global/_content-none.php and then you can change those wordings in the template file.

Hope that helps.

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