Jump to content
Sign in to follow this  
joie

Where to add this php code

Recommended Posts

joie

Hi guys, May be this is not relevant to platform pro. But i am checking if I need to write a child theme for this requirement. I have been using these 2 plugins : 1.Dynamic widgets - to add logic which text widget appear at what page 2.OnlineBooking calendar - to allow visitor book something. To add online booking form to the specific page usually i create a text widget, add some shortcode and put it on a primary sidebar. Then i set the dynamic widget options to appear at what page. Now i need to add some logic to how the booking form is displayed and the way to do it according to plugin creator is to add some code like below

	<?php if ( strpos($_SERVER['REQUEST_URI'],'/my-url/') !==false ) { ?>
	<label for="calendar_type">Type of booking:</label>
	<select name="active_booking_form" onchange="jWPDev('.bk_forms').css('display', 'none');
	document.getElementById(this.value).style.display='block';" >
	<option selected="selected" value="select">Please Select</option>
	<?php global $wpdb;
	$types_list = $wpdb->get_results( "SELECT booking_type_id as id, title FROM ".$wpdb->prefix ."bookingtypes WHERE parent = 0" );
	foreach ($types_list as $tl) { ?>
	<option value="<?php echo $tl->id; ?>"><?php echo $tl->title; ?></option>
	<?php } ?>
	</select>
	
	<?php foreach ($types_list as $tl) { ?>
	<div class="bk_forms" id="<?php echo $tl->id; ?>" style="display: none;"><?php do_action('wpdev_bk_add_form', $tl->id, 1); ?></div>
	<?php } ?>
	
	<?php } ?>
	

Does anyone has an idea where to put this code? Is it on the platform pro php file or I should be looking at the plugin php file ? thank you, regards, joie

Share this post


Link to post
Share on other sites
joie

I found a plugin that solve this. I use Shortcode Exec PHP plugin define some shortcode by replacing the <php> tag with echo command wherever applicable

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×