To resolve the issue with floor plans in the theme, follow these steps:
Modify the Floor Plan Section
Go to libs/property_page_functions/property_floor_plan_section_functions.php
and locate the function:
if ( ! function_exists( 'estate_floor_plan' ) ) :
function estate_floor_plan( $post_id, $is_print = 0, $wpestate_prop_all_details = '' ) {
// Set up print class if needed
$is_print_class = $is_print ? ' floor_print_class ' : '';
// Get measurement unit
$unit = wpestate_get_meaurement_unit_formated();
// Fetch floor plan data
$plan_data = estate_get_floor_plan_data( $post_id, $wpestate_prop_all_details );
// Set up currency details
$wpestate_currency = esc_html( wpresidence_get_option( 'wp_estate_currency_symbol', '' ) );
$where_currency = esc_html( wpresidence_get_option( 'wp_estate_where_currency_symbol', '' ) );
// Initialize lightbox content and counter
$lightbox = '';
$counter = 0;
$show = ' style="display:none"; ';
// Display floor plans
if ( is_array( $plan_data['titles'] ) ) {
print '<div class="row ' . esc_attr( $is_print_class ) . '">';
foreach ( $plan_data['titles'] as $key => $plan_name ) {
$counter++;
estate_display_single_floor_plan( $key, $plan_data, $unit, $wpestate_currency, $where_currency, $is_print_class, $show, $counter );
$lightbox .= estate_generate_lightbox_content(
$plan_data['titles'][$key],
$plan_data['descriptions'][$key],
$plan_data['image_attachs'][$key],
estate_get_plan_details( $key, $plan_data, $unit, $wpestate_currency, $where_currency ),
$counter
);
$show = '';
}
// Enqueue necessary scripts
wp_enqueue_script( 'owl_carousel' );
// Include floor plans gallery template
include( locate_template( 'templates/listing_templates/floorplans_gallery.php' ) );
// Add inline script to initialize lightbox
wp_add_inline_script( 'owl_carousel', '
jQuery(document).ready(function($){
estate_start_lightbox_floorplans();
});
' );
print '</div>';
}
}
endif;
To change the variable $show
, update it to:
$show = ' style="display:none"; ';
How to Disable Floor Plan Lightbox
To disable the floor plan lightbox, go to libs/property_page_functions/property_floor_plan_section_functions.php
and locate the function estate_floor_plan
. Remove the following lines:
wp_add_inline_script( 'owl_carousel', '
jQuery(document).ready(function($){
estate_start_lightbox_floorplans();
});
');
How to Remove the Floor Plan Image Link
To remove the floor plan image link, go to libs/property_page_functions/property_floor_plan_section_functions.php
and locate the function estate_display_floor_plan_image
. Remove the <a>
tags around the image.
function estate_display_floor_plan_image( $plan_name, $plan_desc, $full_img_path, $is_print_class, $show, $counter ) {
?>
<div class="front_plan_row_image <?php echo esc_attr( $is_print_class ); ?>">
<div class="floor_image">
<img class="lightbox_trigger_floor" src="<?php echo esc_url( $full_img_path ); ?>"
alt="<?php echo esc_attr( $plan_name ); ?>"
data-slider-no="<?php echo esc_attr( $counter ); ?>" />
</div>
<div class="floor_description"></div>
</div>
<?php
}