This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'propertyhive_after_search_results_loop_item_title', 'jons_propertyhive_search_address', 7 ); | |
add_action( 'propertyhive_after_search_results_loop_item_title', 'jons_propertyhive_search_bedrooms', 8 ); | |
function jons_propertyhive_search_address() { | |
?> | |
<div class="address"> | |
<?php echo $property->get_formatted_full_address(); ?> | |
</div> | |
<?php | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Logo Block | |
function getCustomLogo() { | |
// set empty return value | |
$logo = get_option('header_logo'); | |
if ($logo !== FALSE) { | |
$logo_url = wp_get_attachment_url($logo); | |
if( $logo_url !== FALSE ) { | |
return $logo_url; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Loop Summary | |
* | |
* @author PropertyHive | |
* @package PropertyHive/Templates | |
* @version 1.0.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'property', | |
'post_status' => 'publish', | |
'nopaging' => true, | |
'orderby' => 'rand', | |
'meta_query' => array( | |
array( | |
'key' => '_on_market', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Single Property title | |
* | |
* @author PropertyHive | |
* @package PropertyHive/Templates | |
* @version 1.0.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'template_redirect', 'default_search_form_to_lettings' ); | |
function default_search_form_to_lettings() | |
{ | |
global $post; | |
if ($post->ID == 2) // REPLACE '2' WITH THE PAGE ID OF YOUR LETTINGS PAGE | |
{ | |
$_GET['department'] = 'residential-lettings'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add lettings fees box to property | |
add_action( 'propertyhive_property_residential_lettings_details_fields', 'add_lettings_fees_box_to_property' ); | |
function add_lettings_fees_box_to_property() | |
{ | |
// Available Date | |
propertyhive_wp_textarea_input( array( | |
'id' => '_lettings_fees', | |
'label' => __( 'Lettings Fees', 'propertyhive' ), | |
'desc_tip' => false | |
) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add lettings fees on property to RTDF feed | |
add_filter( 'ph_rtdf_send_request_data', 'add_property_lettings_fees_to_rtdf_feed', 10, 2 ); | |
function add_property_lettings_fees_to_rtdf_feed( $request_data, $post_id ) | |
{ | |
$property_lettings_fees = get_post_meta( $post_id, '_lettings_fees', TRUE ); | |
if ($property_lettings_fees != '') | |
{ | |
$request_data['property']['price_information']['administration_fee'] = $property_lettings_fees; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'propertyhive_property_address_fields', 'add_property_address_validation' ); | |
function add_property_address_validation() | |
{ | |
?> | |
<script> | |
jQuery('.wrap form').submit(function() | |
{ | |
if (jQuery(this).find('input[name=\'_address_three\']').val() == '') | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'propertyhive_register_post_type_property', 'add_featured_image_to_properties' ); | |
function add_featured_image_to_properties($property_post_type_args = array()) | |
{ | |
$property_post_type_args['supports'][] = 'thumbnail'; | |
return $property_post_type_args; | |
} | |
add_theme_support( 'post-thumbnails' ); // this line might not be needed, depending on your theme |