How to change the number of months in calendar at single property page

Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking How to change the number of months in calendar at single property page

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #959766
    J. Davis
    Keymaster

    Hi,

    In order to change the number of months in the availability calendar on the page of the accommodation type you may add the following code to functions.php file:

    //remove the default calendar
    
    remove_action( 'mphb_render_single_room_type_metas', array( '\MPHB\Views\SingleRoomTypeView', 'renderCalendar' ), 40 );
    
    //register a new custom function to add shortcode where you can change the number of the months
    
    add_action( 'mphb_render_single_room_type_metas', 'my_theme_custom_calendar', 40 );
    function my_theme_custom_calendar(){
    	echo do_shortcode('[mphb_availability_calendar monthstoshow="1,3"]');
    }

    It is recommended to add the code to functions.php file of the child theme to keep the changes in case the parent theme is updated.

    Best regards,
    J. Davis

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.