skip to Main Content
support@webcodingplace.com

Create Custom Property Listing Styles

You can create custom property listing styles by following this.

  1. Create a template in php extension.
  2. Name it with style prefix like style9.php
  3. Create a directory in the root of your theme (or child theme) named rem
  4. Put style9.php template file in this directory
  5. Use 9 in style attribute of shortcodes to use it
  6. You can use same method to override templates also

Suppose we created a template file named style9.php having inner contents

<div class="landz-box-property box-grid mini">
    <?php do_action( 'rem_property_ribbon', $property_id ); ?>
	<a target="<?php echo $target; ?>" class="hover-effect image image-fill" href="<?php echo get_permalink($property_id); ?>">
		<span class="cover"></span>
		<?php do_action( 'rem_property_picture', $property_id ); ?>
		<h3 class="title"><?php echo get_the_title($property_id); ?></h3>
	</a>
	<span class="price">
		<?php if (get_post_meta( $property_id, 'rem_property_price', true ) != '') { ?>
			<?php echo rem_display_property_sale_price($property_id); ?>
		<?php } ?>
	</span>
	<div class="footer">
		<a target="<?php echo $target; ?>" class="btn btn-default" href="<?php echo get_permalink($property_id); ?>"><?php _e( 'Details', 'real-estate-manager' ); ?></a>
	</div>	
</div>

 

 

Put this file in wp-content/themes/your-activated-theme/rem/

Now use following shortcode to use it.

[rem_list_properties style="9"]

 

Variables to use in Template Files

You can use following php variables in the property template files directly.

  • $area
  • $property_type
  • $address
  • $latitude
  • $longitude
  • $city
  • $country
  • $purpose
  • $status
  • $bathrooms
  • $bedrooms

 

Using Custom Meta in Template Files

You can also display the data from custom fields using data names of the fields. Suppose we have a custom field having data name property_created_date and we want to display its value in the template file. We can use following function. Make sure to prefix dataname with rem_ when using in get_post_meta function.

echo get_post_meta( $property_id, 'rem_property_created_date', true );

 

Rameez

Wordpress Developer

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top