Displaying message if no post

Hello guys.

hoping you can help me with a issue i am having.
So i got a page showing posts ( we use this as a operation page to display when we got issues )
All working well. BUT, i would like to set it up, so if we got not active posts. it just shows a page saying “WE GOT NO ISSUES AT THIS MOMENT”

Do you guys got an idea of how i can achieve this?

Hi @Bentzen,

To achieve that, you have to setup a child theme first:

Then 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/
You will need to create the folder names since this path does not exist yet in your child theme.

Hope this helps. Please let us know how it goes.

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