Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Merv Barrett

    (@mervb1)

    Yes this is possible, the floorplan function is executed using a action which means the default can be disabled and you can add your customisations to execute a light box.

    This is the floorplan function on GitHub

    First you disable the action in your themes functions file with

    remove_action('epl_buttons_single_property', 'epl_button_floor_plan');

    Now create your own floor plan function using the above link as the framework for your new fancy light box floorplan.

    function my_epl_floor_plan_function() {
    
    // Copy the contents of the default floor plan function and put it here then edit the button section to add the class or lightbox code needed.
    
    }
    add_action('epl_buttons_single_property', 'my_epl_floor_plan_function');
    Thread Starter someguywhomakesthings

    (@someguywhomakesthings)

    Hey, Merv.

    Appreciate the help. I was able to get it working! Thanks!

    Plugin Author Merv Barrett

    (@mervb1)

    No problem, happy to help 🙂

    Plugin Author Merv Barrett

    (@mervb1)

    Hi Merv,

    You mentioned in my other thread that the Huge IT Lightbox did not seem to work with this.

    I have now installed FancyBox.

    I added the code you mentioned in above in my theme’s function file. But what exactly do I adjust in the code to make it work with this?

    Thanks.

    Sophie

    Ignore my last message, got it working!

    For those who would like to know, this is what I did to get it working with FancyBox:

    //theme floorplan disable
    remove_action('epl_buttons_single_property', 'epl_button_floor_plan');
    function my_custom_floor_plan_button() {
    	$floor_plan	= get_post_meta( get_the_ID() , 'property_floorplan' , true );
    	$floor_plan_2	= get_post_meta( get_the_ID() , 'property_floorplan_2' , true );
    
    	$links = array();
    	if(!empty($floor_plan)) {
    		$links[] = $floor_plan;
    	}
    	if(!empty($floor_plan_2)) {
    		$links[] = $floor_plan_2;
    	}
    	if ( !empty($links) ) {
    		foreach ( $links as $k=>$link ) {
    			if(!empty($link)) {
    				$number_string = '';
    				if($k > 0) {
    					$number_string = ' ' . $k + 1;
    				}
    				// Adjust the following to achieve your desired output
    				?><span class="epl-floor-plan-button-wrapper<?php echo $number_string; ?>">
    				<a type="button" class="fancybox epl-button epl-floor-plan" href="<?php echo $link; ?>"><?php echo apply_filters( 'epl_button_label_floorplan' , __('Floor Plan', 'epl') ) . $number_string; ?></a></span><?php
    			}
    		}
    	}
    }
    add_action('epl_buttons_single_property', 'my_custom_floor_plan_button');

    Hope this helps

    Sophie

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Floor Plan open to Lightbox’ is closed to new replies.