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 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #959766

    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

    #1389694

    Thanks it works! 🙂 And it looks, that i asked the same question nearly 1 year ago. I found a changed functions.php-file in my directories. the right file has been overwritten by me last days… sorry and thank you for the help!!!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.