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;
   }

   return 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 194in the file my-properties.php located in wp-content » themes » realhomes » assets » classic » partials » page folder:

$property_statuses = get_post_statuses();
$property_status = get_post_status();
echo esc_html( $property_statuses[ $property_status ] );

with this new code:

$property_statuses = get_post_statuses();
$property_status   = inspiry_post_status();
echo esc_html( $property_status );

After the line is replaced it should look like this:

If you are using Modern layout then you can simply change it in wp-content » realhomes » assets » modern » partials » member » properties.php and change the statuses on line number 199.

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/