Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Remove Image Link in Single Accommodation
- This topic has 16 replies, 5 voices, and was last updated 2 years, 7 months ago by J. Davis.
- AuthorPosts
- April 2, 2019 at 8:46 pm #790189Chrissy RaudonisParticipant
I’m running HB with the Divi plugin.
I used the Divi to insert an HB Single Accom. module. I would like the featured image and gallery to display but I do not want the featured image to link to the accommodation’s page. How might I remove the link or specify a different URL?Thank you.
April 8, 2019 at 2:27 pm #792236J. DavisKeymasterHi Chissy,
You may add the filter below to functions.php file of your theme in order to disable link of the main gallery image at accommodation listing:
function theme_mphb_loop_room_type_gallery_main_slider_image_link($mainGalleryFlexsliderOptions) { return 'none'; } add_filter('mphb_loop_room_type_gallery_main_slider_image_link', 'theme_mphb_loop_room_type_gallery_main_slider_image_link', 10);
best regards,
J. DavisApril 10, 2019 at 3:36 pm #793211Chrissy RaudonisParticipantGreat! Can you also tell me how to remove the image link from search results? Also, is there a way that I can change the URL of the “view details” button in the search results?
Thank you!
April 12, 2019 at 11:32 am #793923J. DavisKeymasterHi Chrissy,
The function I provided disables link of big gallery image for room listing including search results. Did you try this?
As for View Details button so you may override the function
mphb_tmpl_the_loop_room_type_view_details_button
. Could you specify why you want to change it and what link you would like to use instead?
It is also possible to hide the button adding proper parameter to search results shortcode.
best regards,
J. DavisApril 12, 2019 at 1:05 pm #793981Chrissy RaudonisParticipantThe function that you gave me did remove the link for the single accommodations module but does not work in the search results.
I found it difficult to customize the individual accommodation page to get it to look and function how we want. Instead we are using custom pages built in divi with a different set of urls. So I would need to be able to substitute a different URL for each accommodation type. Hiding the button would be a last-resort because I would like people to be able to go to the listing from the search results.
Thanks
April 18, 2019 at 2:25 pm #796126J. DavisKeymasterHi Chrissy,
Can you send a website link to check it out? Or is it possible to submit a request so we’ll be able to take closer look at it?
best regards,
J. DavisApril 18, 2019 at 3:47 pm #796197Chrissy RaudonisParticipantSupport ticket submitted – thanks!
April 19, 2019 at 8:05 am #796447J. DavisKeymasterHi Chrissy,
Thank you for your request and website URL provided. I’ve notied you used featured image instead of gallery. So here are the steps to remove link from featured image on search results page and other room type listing pages:
- Copy the following file
\wp-content\plugins\motopress-hotel-booking\templates\loop-room-type\featured-image.php
- paste the file to
wp-content\themes\your-theme-folder\hotel-booking\loop-room-type\
- open the file and remove
<a>
tags e.g
<a href="<?php esc_url( the_permalink() ); ?>">
and</a>
Best regards,
J. DavisApril 19, 2019 at 8:44 pm #796685Chrissy RaudonisParticipantI ended up solving the problem with redirects. Maybe not ideal in some ways but it seemed like the best compromise. Thanks for your help.
May 8, 2020 at 10:12 pm #951663Nicolas Stübi (SPMA Sàrl)ParticipantHello,
Is it possible to also deactivate the hyperlink on images of accommodations?
When it is not a gallery, but a single image?And ideally, also the title.
BR
NicolasMay 12, 2020 at 2:42 pm #952955J. DavisKeymasterHi Nicolas,
I’ve noticed the same question here https://motopress.com/forums/topic/remove-amenity-link/ Could you describe the situation more detailed? Thanks.
best regards,
John DavisOctober 24, 2021 at 11:46 am #1204164Alwin VerduijnParticipantHi John,
Is it also possible to remove the link from the thumbnail image and the room type title ?
I am using Elementor to create a custom accommodation page, but with the single accommodation type ‘widget’ there is always a link added to the featured images and the room type title.
I hope there is a way to remove these links 🙂
Thanks in advance!
With kind regards,
Alwin Verduijn
October 26, 2021 at 6:34 am #1205026Andre FloresModeratorHello Alwin,
It is possible via custom CSS. If you provide me with an example URL, I will gladly provide CSS code to get rid of undesired links.
Regards,
AndreNovember 2, 2021 at 6:02 am #1208181Alwin VerduijnParticipantHello Andre,
Sorry for the late response. I found a way to do this myself with css now 🙂 Thanks anyway!
With kind regards,
Alwin Verduijn
November 11, 2021 at 3:24 am #1212610Andre FloresModeratorHello Alwin,
You are most welcome 🙂 I am glad that you have managed to resolve the issue.
Regards,
Andre - Copy the following file
- AuthorPosts
- You must be logged in to reply to this topic.