Hi @wmewme,
Thanks for your question. Some shortcodes of the Hotel Booking plugin may fetch the ID of the current post automatically e.g. [mphb_availability] and [mphb_availability_calendar]
You may add other elements of the property as custom shortcodes too, for example:
1. Price [mphb_property_price]
code
function mphb_property_price_shortcode() {
if ( is_singular( 'mphb_room_type' ) ) {
if ( mphb_tmpl_has_room_type_default_price() ) :
do_action( 'mphb_render_single_room_type_before_price' );
mphb_tmpl_the_room_type_default_price();
do_action( 'mphb_render_single_room_type_after_price' );
endif;
}
}
add_shortcode('mphb_property_price', 'mphb_property_price_shortcode');
2. Gallery [mphb_property_gallery]
code
function mphb_property_gallery_shortcode() {
if ( is_singular( 'mphb_room_type' ) ) {
if ( mphb_tmpl_has_room_type_gallery() ) :
do_action( 'mphb_render_loop_room_type_before_gallery' );
mphb_tmpl_the_room_type_flexslider_gallery();
do_action( 'mphb_render_loop_room_type_after_gallery' );
endif;
}
}
add_shortcode('mphb_property_gallery', 'mphb_property_gallery_shortcode');
3. Details [mphb_property_details]:
code
function mphb_property_details_shortcode() {
if ( is_singular( 'mphb_room_type' ) ) {
do_action( 'mphb_render_single_room_type_before_attributes' );
do_action( 'mphb_render_single_room_type_attributes' );
do_action( 'mphb_render_single_room_type_after_attributes' );
}
}
add_shortcode('mphb_property_details', 'mphb_property_details_shortcode');
The script should be added to the functions.php file of the theme. Thus you may use shortcodes in template builder without indicating IDs and soo ID will be fetched automatically on each property page where this template is applied.
We also have this feature on our to-do list so we hope to prepare more shortcodes to be able to build the property templates in a more easy way.