• Resolved w-sky

    (@w-sky)


    Hello,

    I would like to add a simple paragraph of text below the single accommodation view of our website for all accommodations. Is this possible?

    (It’s going to be: “If you have any questions before you book, please send us a message.”, linked to a contact form.)

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @w-sky,
    You may try adding the code below to functions.php file of the theme:

    add_action( 'mphb_render_single_room_type_metas', 'add_custom_text_below_content' , 60 );
     
    function add_custom_text_below_content(){
    	 echo '<p>If you have any questions before you book, please <a href="/imprint">send us a message</a><p>';
    }

    It is recommended to install a child theme and add the code to its functions.php file no to lose the changes after the theme update.

    Thread Starter w-sky

    (@w-sky)

    Thank you. I guess this would work, but we decided that we don’t want to use a child theme. It will be okay without.

    Edit:
    On second thought I guess the authors of Hotel Booking are where I should post the following as a suggestion:

    I want to leave this as a suggestion: Either have optional editable content fields in preferences to display above and/or below the accommodation details in single acc. view, or use a page with shortcode as a template for single accommodation view.

    • This reply was modified 4 years, 1 month ago by w-sky.

    Hi @w-sky,
    Thanks for your reply you may add this code to your custom plugin or use a third-party plugin to add functions and other PHP code to your site in a safe way.
    I’ve already added your request to our list of the features for the Hotel Booking plugin. We will notify you if we have any news.

    Thread Starter w-sky

    (@w-sky)

    Hello again, we are now using the “Code Snippets” plugin and I have added the function from above. It’s working fine, however as our site is multilingual with WPML, I had to change it like this:

    add_action( 'mphb_render_single_room_type_metas', 'add_custom_text_below_content' , 60 );
    
    function add_custom_text_below_content(){
    	$link = __('mylink','MotoPress Hotel Booking');
    	$text = __('If you have any questions before you book, please','MotoPress Hotel Booking');
    	$linktext = __('send us a message','MotoPress Hotel Booking');
    	echo '<p>&nbsp;</p><p>'.$text.' <a href="'.$link.'">'.$linktext.'</a>.</p>';
    }

    Also, to add space between the button and text below, I’ve added that <p> </p> part.

    Hello @w-sky,

    Thank you for sharing your code, it is much appreciated. I am sure it might help other users, who has the same request.

    Regards,
    Arsen

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Text below single accommodation view / edit template?’ is closed to new replies.