RealtyPress v1.5.0 is the first version that has required changes to the default template files since v1.0.0.
If you created a child of RealtyPress template files pre v1.5.0 they will need to be updated to support some of the new features in v1.5.0.
We have provided the following guide to help you update your child template but it is ultimately your responsibility to do so.
Before modifying your child template always create a backup first.
Files that required editing are:
Single Listing Templates
property-single-view.php
partials/property-single-agent-h.php
partials/property-single-agent-v.php
partials/property-single-details.php
partials/property-single-intro.php
partials/property-single-photos.php
Property Result Templates
partials/property-result-grid.php
partials/property-result-list.php
Shortcode Templates
shortcodes/shortcode-property-carousel.php
shortcodes/shortcode-property-slider.php
shortcodes/shortcode-listing-preview-h.php
shortcodes/shortcode-listing-preview-v.php
shortcodes/shortcode-listing-favorites.php
CSS
css/styles.css
css/shortcodes.css
property-single-view.php
Find this line.
<?php echo $tpl->get_template_part( 'partials/footer-mls', $tpl_data ); ?>
Wrap this line in the following if statement as below.
<?php if( $property['private']['CustomListing'] != '1' ) { ?> <?php echo $tpl->get_template_part( 'partials/footer-mls', $tpl_data ); ?> <?php } ?>
partials/property-single-agent-h.php
Find the following block of code
<!-- Phone Numbers --> <p> <?php $office_phones = json_decode( $office['Phones'], true ); if( !empty( $office_phones ) ) { foreach($office_phones as $phone) { if( is_string( $phone ) ) { echo '<span' . rps_schema( 'telephone', '' , '', '' ) . '>' . $phone . '</span><br>'; } elseif( is_array( $phone ) ) { if( !empty( $phone['PhoneType'] ) ) { echo '<strong>' . $phone['PhoneType'].'</strong>: '; } echo '<span' . rps_schema( 'telephone', '' , '', '' ) . '>' . $phone['Phone'] . '</span><br>'; } } } $agent_websites = json_decode( $office['Websites'], true ); if( !empty( $agent_websites ) ) { foreach($agent_websites as $website) { if( is_string( $website ) ) { echo '<span' . rps_schema( 'website', '' , '', '' ) . '>' . str_replace( 'http://', '', $website ) . '</span><br>'; } elseif( is_array( $website ) ) { if( !empty( $website['WebsiteType'] ) ) { echo '<strong>' . $website['WebsiteType'].'</strong>: '; } echo '<span' . rps_schema( 'website', '' , '', '' ) . '>'; echo '<a href="' . $website['Website'] . '" target="_blank">' . str_replace( 'http://', '', $website['Website'] ) . '</a>'; echo '</span><br>'; } } } ?> </p>
Replace the above with the following.
<!-- Phones & Websites --> <?php $agent_phones = json_decode( $values['Phones'], true ); if( !empty( $agent_phones ) ) { echo rps_show_contact_phones($agent_phones); } $agent_websites = json_decode( $values['Websites'], true ); if( !empty( $agent_websites ) ) { echo rps_show_contact_websites($agent_websites); } ?>
partials/property-single-agent-v.php
Find the following block of code
<!-- Phone Numbers --> <p> <?php $office_phones = json_decode( $office['Phones'], true ); if( !empty( $office_phones ) ) { foreach($office_phones as $phone) { if( is_string( $phone ) ) { echo '<span' . rps_schema( 'telephone', '' , '', '' ) . '>' . $phone . '</span><br>'; } elseif( is_array( $phone ) ) { if( !empty( $phone['PhoneType'] ) ) { echo '<strong>' . $phone['PhoneType'].'</strong>: '; } echo '<span' . rps_schema( 'telephone', '' , '', '' ) . '>' . $phone['Phone'] . '</span><br>'; } } } $agent_websites = json_decode( $office['Websites'], true ); if( !empty( $agent_websites ) ) { foreach($agent_websites as $website) { echo '<br>'; if( is_string( $website ) ) { echo '<span' . rps_schema( 'website', '' , '', '' ) . '>' . str_replace( 'http://', '', $website ) . '</span><br>'; } elseif( is_array( $website ) ) { if( !empty( $website['WebsiteType'] ) ) { echo '<strong>' . $website['WebsiteType'].'</strong>: '; } echo '<span' . rps_schema( 'website', '' , '', '' ) . '>'; echo '<a href="' . $website['Website'] . '" target="_blank">' . str_replace( 'http://', '', $website['Website'] ) . '</a>'; echo '</span><br>'; } } } ?> </p>
Replace the above with the following.
<!-- Phones & Websites --> <p> <?php $office_phones = json_decode( $office['Phones'], true ); if( !empty( $office_phones ) ) { echo rps_show_contact_phones($office_phones); } $office_websites = json_decode( $office['Websites'], true ); if( !empty( $office_websites ) ) { echo rps_show_contact_websites($office_websites); } ?> </p>
partials/property-single-details.php
Find the following line.
<strong>MLS® Number</strong>
Update as below.
<?php if( $property['private']['CustomListing'] == 1 && $name == "ListingID" ) { ?> <strong>RP Number</strong> <?php } else { ?> <strong>MLS® Number</strong> <?php } ?>
partials/property-single-intro.php
Find the following block of code.
<!-- Meta --> <meta<?php echo rps_schema( 'priceCurrency', '' , '', '' ) ?> content="CAD" /> <meta<?php echo rps_schema( 'price', '' , '', '' ) ?> content="<?php echo rps_format_price( $property['transaction'], 'raw' ); ?>"> <!-- Price --> <h2 class="rps-pricing rps-text-center-sm"><?php echo rps_format_price($property['transaction'], 'full') ?></h2>
Update as below.
<?php if( $property['private']['Sold'] != 1 ) { ?> <!-- Meta --> <meta<?php echo rps_schema( 'priceCurrency', '' , '', '' ) ?> content="CAD" /> <meta<?php echo rps_schema( 'price', '' , '', '' ) ?> content="<?php echo rps_format_price( $property['transaction'], 'raw' ); ?>"> <!-- Price --> <h2 class="rps-pricing rps-text-center-sm"><?php echo rps_format_price($property['transaction'], 'full') ?></h2> <?php } else { ?> <h1 class="rps-pricing rps-text-center-sm">SOLD</h1> <?php } ?>
partials/property-single-photos.php
You will find 3 occurences of the following in the file.
if( !empty( $property['property-photos'][0]['Photos'] ) ) { foreach( $property['property-photos'] as $img ) { $photos = json_decode($img['Photos'], true); $i = 0; foreach($photos as $size => $values) {
Move “$i = 0;” as below for all 3 occurences.
if( !empty( $property['property-photos'][0]['Photos'] ) ) { $i = 0; foreach( $property['property-photos'] as $img ) { $photos = json_decode($img['Photos'], true); foreach($photos as $size => $values) {
You will also find 3 occurences of the followin line.
echo '<a data-slide-index="' . $sequence_id . '" href="" rel="nofollow">';
Replace the $sequence_id var with $i as below for all 3 occurences.
echo '<a data-slide-index="' . $i . '" href="" rel="nofollow">';
Find the following which is located around line 106
</ul><!-- /.bx-slider --> </div><!-- /bx-wapper -->
Insert the SOLD if statement between the above tags as below.
</ul><!-- /.bx-slider --> <?php if( $property['private']['Sold'] == 1 ) { ?> <div class="rps-ribbon rps-ribbon-sold"> <span>SOLD</span> </div> <?php } ?> </div><!-- /bx-wapper -->
partials/property-result-grid.php
First we update the columns being retrieved to include CustomListing and Sold values.
Find these lines
$property_cols = "TransactionType, PostID, ListingID, BusinessType, StreetAddress, City, Province, BedroomsTotal, BathroomTotal, SizeInterior, OpenHouse, OwnershipType, Price, PricePerTime, PricePerUnit, Lease, LeasePerTime, LeasePerUnit, LeaseTermRemaining, LeaseTermRemainingFreq, LastUpdated, LastUpdated"; $property = $crud->rps_get_post_listing_details( $post->ID, $property_cols );
Add “CustomListing, Sold” to the $property_cols string.
$property_cols = "TransactionType, PostID, ListingID, BusinessType, StreetAddress, City, Province, BedroomsTotal, BathroomTotal, SizeInterior, OpenHouse, OwnershipType, Price, PricePerTime, PricePerUnit, Lease, LeasePerTime, LeasePerUnit, LeaseTermRemaining, LeaseTermRemainingFreq, LastUpdated, LastUpdated, CustomListing, Sold"; $property = $crud->rps_get_post_listing_details( $post->ID, $property_cols );
partials/property-result-list.php
Next we need to adjust the output of transaction type and open house ribbons as well as pricing.
Find the following block of code
<?php if( $property['transaction']['TransactionType'] ) { ?> <?php if( strtolower($property['transaction']['TransactionType']) == 'for sale') { ?> <span class="rps-ribbon rps-ribbon-info top-ribbon"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } elseif( strtolower($property['transaction']['TransactionType']) == 'for lease') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } elseif( strtolower($property['transaction']['TransactionType']) == 'for rent') { ?> <span class="rps-ribbon rps-ribbon-warning top-ribbon"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } else if( strtolower($property['transaction']['TransactionType']) == 'for sale or rent') { ?> <span class="rps-ribbon rps-ribbon-success top-ribbon"><?php echo str_replace( 'sale or', 'sale<br>or', $property['transaction']['TransactionType'] ) ?></span> <?php } ?> <?php } ?> <?php if( !empty( $property['open-house']['OpenHouse'] ) ) { ?> <span class="rps-ribbon rps-ribbon-open-house right">OPEN HOUSE</span> <?php } ?> <!-- Price --> <?php if( $property['transaction'] ) { ?> <span class="rps-price rps-price-default"><?php echo rps_format_price( $property['transaction'] ) ?></span> <?php } ?>
Wrap this block in the following if statement as below.
<?php if( $property['private']['Sold'] != 1 ) { ?> <?php if( $property['transaction']['TransactionType'] ) { ?> <?php if( strtolower($property['transaction']['TransactionType']) == 'for sale') { ?> <span class="rps-ribbon rps-ribbon-info top-ribbon"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } elseif( strtolower($property['transaction']['TransactionType']) == 'for lease') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } elseif( strtolower($property['transaction']['TransactionType']) == 'for rent') { ?> <span class="rps-ribbon rps-ribbon-warning top-ribbon"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } else if( strtolower($property['transaction']['TransactionType']) == 'for sale or rent') { ?> <span class="rps-ribbon rps-ribbon-success top-ribbon"><?php echo str_replace( 'sale or', 'sale<br>or', $property['transaction']['TransactionType'] ) ?></span> <?php } ?> <?php } ?> <?php if( !empty( $property['open-house']['OpenHouse'] ) ) { ?> <span class="rps-ribbon rps-ribbon-open-house right">OPEN HOUSE</span> <?php } ?> <!-- Price --> <?php if( $property['transaction'] ) { ?> <span class="rps-price rps-price-default"><?php echo rps_format_price( $property['transaction'] ) ?></span> <?php } ?> <?php } else { ?> <div class="rps-ribbon rps-ribbon-sold"> <span>SOLD</span> </div> <?php } ?>
shortcodes/shortcode-property-carousel.php
Find this line (approx. line 49)
$title = '<div class=\'price\'>' . rps_format_price( $value ) . '</div> ';
Replace with the following
if( $value['Sold'] == 1 ) { $title = '<div class="price sold">SOLD</div> '; } else { $title = '<div class="price">' . rps_format_price( $value ) . '</div> '; }
shortcodes/shortcode-property-slider.php
Find this line (approx. line 48)
$title = '<h3>' . rps_format_price( $value ) . '</h3>';
Replace with the following.
if( $value['Sold'] == '1' ) { $title = '<h3>SOLD</h3>'; } else { $title = '<h3>' . rps_format_price( $value ) . '</h3>'; }
shortcodes/shortcode-listing-preview-h.php
We need to adjust the output of transaction type and open house ribbons as well as pricing.
Find the following block of code
<!-- Image Ribbons --> <?php if( $listing['TransactionType'] ) { ?> <?php if( strtolower($listing['TransactionType']) == 'for sale') { ?> <span class="rps-ribbon rps-ribbon-info top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($listing['TransactionType']) == 'for lease') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($listing['TransactionType']) == 'for rent') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php } ?> <?php if( !empty( $listing['OpenHouse'] ) ) { ?> <span class="rps-ribbon rps-ribbon-open-house right">Open House</span> <?php } ?> <!-- Price --> <div class="rps-price"><?php echo rps_format_price( $listing ) ?></div> <?php if( $fav->rps_check_favorited( $listing['PostID'] ) ) { ?> <!-- Favorited --> <span class="rps-favorited-heart pull-right"> <i class="fa fa-heart" style=""></i> </span> <?php } ?>
Wrap this block in the following if statement as below.
<?php if( $listing['Sold'] != 1 ) { ?> <!-- Image Ribbons --> <?php if( $listing['TransactionType'] ) { ?> <?php if( strtolower($listing['TransactionType']) == 'for sale') { ?> <span class="rps-ribbon rps-ribbon-info top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($listing['TransactionType']) == 'for lease') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($listing['TransactionType']) == 'for rent') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php } ?> <?php if( !empty( $listing['OpenHouse'] ) ) { ?> <span class="rps-ribbon rps-ribbon-open-house right">Open House</span> <?php } ?> <!-- Price --> <div class="rps-price"><?php echo rps_format_price( $listing ) ?></div> <?php if( $fav->rps_check_favorited( $listing['PostID'] ) ) { ?> <!-- Favorited --> <span class="rps-favorited-heart pull-right"> <i class="fa fa-heart" style=""></i> </span> <?php } ?> <?php } else { ?> <div class="rps-ribbon rps-ribbon-sold"> <span>SOLD</span> </div> <?php } ?>
shortcodes/shortcode-listing-preview-v.php
We need to adjust the output of transaction type and open house ribbons as well as pricing.
Find the following block of code
<!-- Image Ribbons --> <?php if( $listing['TransactionType'] ) { ?> <?php if( strtolower($listing['TransactionType']) == 'for sale') { ?> <span class="rps-ribbon rps-ribbon-info top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($listing['TransactionType']) == 'for lease') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($listing['TransactionType']) == 'for rent') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php } ?> <?php if( !empty( $listing['OpenHouse'] ) ) { ?> <span class="rps-ribbon rps-ribbon-open-house right">Open House</span> <?php } ?> <!-- Price --> <div class="rps-price"><?php echo rps_format_price( $listing ) ?></div> <?php if( $fav->rps_check_favorited( $listing['PostID'] ) ) { ?> <!-- Favorited --> <span class="rps-favorited-heart pull-right"> <i class="fa fa-heart" style=""></i> </span> <?php } ?>
Wrap this block in the following if statement as below.
<?php if( $listing['Sold'] != 1 ) { ?> <!-- Image Ribbons --> <?php if( $listing['TransactionType'] ) { ?> <?php if( strtolower($listing['TransactionType']) == 'for sale') { ?> <span class="rps-ribbon rps-ribbon-info top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($listing['TransactionType']) == 'for lease') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($listing['TransactionType']) == 'for rent') { ?> <span class="rps-ribbon rps-ribbon-danger top-ribbon"><?php echo $listing['TransactionType'] ?></span> <?php } ?> <?php } ?> <?php if( !empty( $listing['OpenHouse'] ) ) { ?> <span class="rps-ribbon rps-ribbon-open-house right">Open House</span> <?php } ?> <!-- Price --> <div class="rps-price"><?php echo rps_format_price( $listing ) ?></div> <?php if( $fav->rps_check_favorited( $listing['PostID'] ) ) { ?> <!-- Favorited --> <span class="rps-favorited-heart pull-right"> <i class="fa fa-heart" style=""></i> </span> <?php } ?> <?php } else { ?> <div class="rps-ribbon rps-ribbon-sold"> <span>SOLD</span> </div> <?php } ?>
shortcodes/shortcode-listing-favorites.php
We need to adjust the output of transaction type and open house ribbons as well as pricing.
Find the following block of code
<!-- Image Ribbons --> <?php if( $property['transaction']['TransactionType'] ) { ?> <?php if( strtolower($property['transaction']['TransactionType']) == 'for sale') { ?> <span class="rps-ribbon top-ribbon rps-ribbon-info"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($property['transaction']['TransactionType']) == 'for lease') { ?> <span class="rps-ribbon top-ribbon rps-ribbon-danger"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($property['transaction']['TransactionType']) == 'for rent') { ?> <span class="rps-ribbon top-ribbon rps-ribbon-danger"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } ?> <?php } ?> <!-- Price --> <div class="rps-price"><?php echo rps_format_price( $property['transaction'] ) ?></div> <!-- Favorited --> <span class="rps-favorited-heart pull-right"> <i class="fa fa-heart" style=""></i> </span>
Wrap this block in the following if statement as below.
<?php if( $property['private']['Sold'] != 1 ) { ?> <!-- Image Ribbons --> <?php if( $property['transaction']['TransactionType'] ) { ?> <?php if( strtolower($property['transaction']['TransactionType']) == 'for sale') { ?> <span class="rps-ribbon top-ribbon rps-ribbon-info"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($property['transaction']['TransactionType']) == 'for lease') { ?> <span class="rps-ribbon top-ribbon rps-ribbon-danger"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } ?> <?php if( strtolower($property['transaction']['TransactionType']) == 'for rent') { ?> <span class="rps-ribbon top-ribbon rps-ribbon-danger"><?php echo $property['transaction']['TransactionType'] ?></span> <?php } ?> <?php } ?> <!-- Price --> <div class="rps-price"><?php echo rps_format_price( $property['transaction'] ) ?></div> <!-- Favorited --> <span class="rps-favorited-heart pull-right"> <i class="fa fa-heart" style=""></i> </span> <?php } else { ?> <div class="rps-ribbon rps-ribbon-sold"> <span>SOLD</span> </div> <?php } ?>
css/styles.php
Add the following CSS.
.rps-single-listing-map-tabs .tab-content { margin-bottom:30px; border: 3px solid #ddd; border-top:0; max-height:504px; overflow:hidden; } .rps-single-listing-map-tabs .tab-pane .tab-map { height:500px !important; } /* Sold Label */ .bootstrap-realtypress .rps-result-feature-label-sold { color: #fff; font-size:18px; padding:4px 8px; background: #d9534f; margin-right:3px; margin-bottom:3px; border-radius: none; display:block; float:left; } /* Sold Ribbons */ .bootstrap-realtypress .bx-wrapper .rps-ribbon-sold, .bootstrap-realtypress .image-holder .rps-ribbon-sold { position:absolute; left: 0; right: 0; top: 0; bottom: 0; width:100%; height:100%; background-color: rgba(0,0,0,0.4); border:none; } .bootstrap-realtypress .bx-wrapper .rps-ribbon-sold span, .bootstrap-realtypress .image-holder .rps-ribbon-sold span { position: relative; left: 0; right: 0; top: 50%; bottom: 0; font-weight: 700; font-size: 42px; color: #ffffff; border: 1px solid white; transform: translateY(-50%); padding: 0px 5px; } .bootstrap-realtypress .bx-pager-wrap.horizontal .bx-pager .slide a.active{ border: 3px solid #e6e6e6 !important; }
The following updates must also be made.
Find the following CSS
.bootstrap-realtypress .image-holder .rps-ribbon { color: #fff; font-size: 10px; line-height: 12px; font-weight: 700; position: absolute; text-align: center; text-transform: uppercase; z-index: 90; }
Update to
.bootstrap-realtypress .bx-wrapper .rps-ribbon, .bootstrap-realtypress .image-holder .rps-ribbon { color: #fff; font-size: 10px; line-height: 12px; font-weight: 700; position: absolute; text-align: center; text-transform: uppercase; z-index: 90; }
Find the following CSS
.bootstrap-realtypress .rps-single-listing .rps-agent-details { background: #ffffff; padding:10px; margin-bottom: 30px; font-size:0.9em; border: 1px solid #e6e6e6; } .bootstrap-realtypress .rps-single-listing .rps-agent-details .agent-photo { border: 3px solid #ddd; float:left; margin: 0 10px 10px 0; }
Update to
.bootstrap-realtypress .rps-single-listing .rps-agent-details { background: #ffffff; padding:10px; margin-bottom: 30px; font-size:0.9em; border: 1px solid #e6e6e6; word-break: break-word; } .bootstrap-realtypress .rps-single-listing .rps-agent-details .agent-photo { border: 3px solid #ddd; float:left; margin: 0 10px 10px 0; max-width: 100px; }
css/shortcodes.css
Add the following CSS.
.bootstrap-realtypress .rps-listing-carousel-shortcode .bx-wrapper .bx-caption .price.sold { font-size: 32px; line-height: 36px; text-align:center; }
Other Changes
The following files;
partials/property-result-search-form-h.php
partials/property-result-search-form-v.php
partials/property-filter-location-form.php
shortcodes/shortcode-search-form-h.php
shortcodes/shortcode-search-form-v.php
shortcodes/shortcode-search-location-form.php
Require the following MLS reference.
MLS® Number
To be replaced with.
MLS® or RP Number