Tagged: acf, advanced custom fields, attachment page, gallery, image, single.php
-
AuthorPosts
-
April 15, 2020 at 5:23 pm #1204062
Hello,
I hope all are well at Kriesi.at! I found a thread about adding a link to an image (in a gallery) here:
https://kriesi.at/support/topic/adding-links-to-a-gallery/But that refers to a now defunct plugin. Instead, I’m trying to use Gallery Custom Links. I believe that the page to call is single.php, but when I add the code from that previous thread to single.php, it doesn’t work…which doesn’t surprise me because those plugins are likely built very differenty.
My end goal here is to use the Gallery element in Enfold and to have the images link to an attachment page where I can display the ACF filed values I’ve set up.
Any guidance here would be helpful. Thank you so much.
KC
April 15, 2020 at 9:19 pm #1204169Hey milkrow,
Try using the av_gallery shortcode:
[av_gallery ids='316,315,314,313' style='thumbnails' preview_size='portfolio' crop_big_preview_thumbnail='avia-gallery-big-crop-thumb' thumb_size='portfolio' columns='4' imagelink='lightbox' lazyload='avia_lazyload' alb_description='' id='' custom_class='' av_uid='av-k91pwd71' admin_preview_bg='']
Just replace 316,315,314,313 with the image/attachment IDs.
Best regards,
NikkoApril 28, 2020 at 5:45 pm #1207880Hi guys!!
I’m having trouble on media attachment, Enfold media attachment are shown as single URL and not redirected to post/ page.
Any idea?
Many thanks!
DavidMay 1, 2020 at 4:55 am #1208712Hi David,
Please open a new thread and include WordPress admin login details in private so that we can have a closer look at your site. Also please try to explain the problem you are having a bit further as I’m not sure I understand it.
Best regards,
RikardMay 1, 2020 at 2:10 pm #1208835May 2, 2020 at 7:40 am #1209057July 1, 2020 at 12:24 am #1227025Hi Nikko, sorry it has taken me awhile to follow up on your suggestion. I now realize that a shortcode solution isn’t very user friendly for someone (the end client) who doesn’t understand how they work…it isn’t intuitive (enough). The gallery block works best because one can drag and drop the images, it’s visual. So, I’m wondering how I can set the lightbox images to link to an attachment page. I thought perhaps I could use the image’s permalink…but no image is displayed on that page, likely because index.php doesn’t call the image? Is there another template that I can specify? I’ve been trying to find a solution to what I thought was a pretty basic thing…gallery image links to a page where more detail about the image can be viewed. Any guidance would be very helpful.
July 1, 2020 at 5:19 pm #1227286Any help on how to get the image to appear on its own attachment page might do the trick here…
July 2, 2020 at 6:03 am #1227387Hi milkrow,
I apologize for misunderstanding, if I’m not mistaken you just want to have an image gallery but instead of opening in a lightbox it does go to the image attachment page?
Please use Masonry Gallery instead, in the Content (tab) > Captions > Element Title and Excerpt, set this to Display Neither, then in Styling (tab) > Sizing Settings > set this to Perfect Grid.
Then set other settings such as Gap between elements and No of columns.To add a custom link to each image, select an image and you should see Custom Link in the right side and add a link to it.
If it contains a link it should open the link but if it’s not set it opens a lightbox.Best regards,
NikkoJuly 3, 2020 at 3:22 pm #1227774Hi Nikko,
Thank you for your assistance. I’m aware of how to add a custom link to the image such that the gallery thumbnail will link to the attachment page. Rather, I was trying to link the lightbox image to the attachment page. In other words, you click the thumbnail, the lightbox pops up, but intead of the click behavior (on the image) being an advance to the next image…it would go to the attachment page.The next issue is that the attachment page in the Enfold theme does not display the image. Shouldn’t it? I’m sure there must be an obvious reason for this, but I’m not able to determine why no image is show on the attachment page.
I have a child theme set up, so I could dupe a page template and alter it…though, I’m not extremely familiar with PHP, so I’d need a little help. I think a solution of this nature might be really useful for a bunch of Enfold users. So if you could provide a little guidance here, we can document the process for others.
Best, KCJuly 3, 2020 at 3:50 pm #1227781One other note, the custom links do no work on the Masonry lightbox when the lightbox linking is deactivated. No link appears on media which has a custom link specified.
July 6, 2020 at 3:18 am #1228135Hi,
Sorry for the late reply, I tested the plugin Gallery Custom Links and while it seems to work with our gallery element the plugin disables the lightbox on any image that it adds the link to, so this plugin is not going to be able to add the link to the lightbox image after it is opened. I tried taking a look at the plugin source code to see if I could modify it, but I was not successful.
I also tested if the attachment page was being created when media is added to the media library, and it is. If you include an admin login we could investigate further.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.