Linking images to pages via HTML?

  • Unknown's avatar

    I have been going crazy trying to get this to work the last few days, half the time it works and half the time it doesn’t and I think I am only beginning to understand why.
    I am attempting to use the HTML editor to add separate links to photos in a gallery.
    For some reason it would appear that there is no standard option to do so for individual images within a gallery block, only individual images (with the “link” button, which for some reason is completely missing as an option for galleries).

    So far I have replaced the <a href=”” and data-link=”” contents with the desired link to a live page, and it works fine when I use the “preview” tool to test it. I can also switch back from code to visual editor without prompting a block recovery error.
    Unfortunately as soon as I attempt to test it from a third party (accessing my website normally outside of the editor) it defaults back to gallery display.
    Upon further reflection I can only assume that the gallery block has a line(s) of code somewhere that force it to revert changes I’ve made with the links back to showing images as a gallery upon clicking.

    So what I am looking for help with at this point is:

    How do I get my images to line up in as aesthetically pleasing of a way as the gallery allows without using the gallery block (adding individual images leaves massive gaps and wonky formatting)?

    or

    How do I edit the coding of the gallery to keep the pleasing format while removing its native coding to display images contained therein as a gallery instead of redirecting to the desired links?

    I’ve been frustrated with this issue for almost a week now, any help would be absolutely amazing.

    The blog I need help with is: (visible only to logged in users)

  • Hi! Smart thinking on the HTML… I haven’t seen anyone do that yet! I noticed when I mouse over the images on your portfolio page, the URLs show up in the status bar of my browser. But then they open in the carousel.

    So, if you disable the Carousel, does that resolve the issue?
    https://liamgphotographycom.wordpress.com/wp-admin/options-media.php

    Also, I know there are open, in-progress requests to add links to galleries. One for WordPress in general:
    https://github.com/WordPress/gutenberg/issues/10057

    And one for Jetpack’s Tiled Gallery block, which we also use here:
    https://github.com/Automattic/jetpack/issues/13760

    That one is currently flagged Top Priority as of a few days ago, so while I don’t have an ETA, know that should be coming up in the near future.

  • Unknown's avatar

    It would appear that disabling the carousel resolved it, thank you so much! It would have taken me ages to find that options list, clearly I need to explore the wp-admin dashboard a bit more.
    I’m building this website as both a portfolio for my art but also as a self-taught lesson on HTML so I’ve been trying to go under the hood wherever possible, so this makes me feel better since my conclusion that the url was being overridden by the inherent carousel was correct.
    I’m happy to hear that a request has been made to make that option more accessible, I’ll have to keep an eye out for that in the future.

  • The topic ‘Linking images to pages via HTML?’ is closed to new replies.