Remove Image Link in Single Accommodation

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #790189
    Chrissy Raudonis
    Participant

    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.

    #792236
    J. Davis
    Keymaster

    Hi 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. Davis

    #793211
    Chrissy Raudonis
    Participant

    Great! 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!

    #793923
    J. Davis
    Keymaster

    Hi 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. Davis

    #793981
    Chrissy Raudonis
    Participant

    The 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

    #796126
    J. Davis
    Keymaster

    Hi 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. Davis

    #796197
    Chrissy Raudonis
    Participant

    Support ticket submitted – thanks!

    #796447
    J. Davis
    Keymaster

    Hi 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. Davis

    #796685
    Chrissy Raudonis
    Participant

    I ended up solving the problem with redirects. Maybe not ideal in some ways but it seemed like the best compromise. Thanks for your help.

    #951663
    Nicolas Stübi (SPMA Sàrl)
    Participant

    Hello,

    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
    Nicolas

    #952955
    J. Davis
    Keymaster

    Hi 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 Davis

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