Inspiry Menu Created with Sketch.
RELATED TO: Real Homes Theme

If you want to change the post status on my properties page which is shown in the screenshot below then you will learn how you can change that with some quick changes in this article.

First of all, add the following PHP code in your theme’s functions.php file:

function inspiry_post_status() {

   // function reference: https://developer.wordpress.org/reference/functions/get_post_status/
   $post_status = get_post_status();

   switch( $post_status ){
      case 'draft':
         $post_status = 'DRA';
         break;
      case 'pending':
         $post_status = 'PEN';
         break;
      case 'publish':
         $post_status = 'PUB';
         break;
   }

   echo strtolower( $post_status );

}

Please note that you can change the text ‘DRA‘, ‘PEN‘ and ‘PUB‘ with the words of your choice. After adding the above code at the end of functions.php file then kindly change the line 172 in the file template-my-properties.php located in wp-content » themes » realhomes folder:

<h5><?php echo get_post_status(); ?></h5>

with this new code:

<h5><?php inspiry_post_status(); ?></h5>

After the line is replaced it should look like this:

If you still need further assistance or have a question then please feel free to open a ticket on our support site (login required):
https://support.inspirythemes.com/ask-question/