Wow!!! this is what I’ve been searching for the last year!!! where is the code for the gallery field fix please?!!! @neosavedme
I am really baffled that there is no demand for fixing the gallery on mobile. I use frontend forms to let users edit their posts, but when it comes to gallery, I can not use that field.
They can’t reorder nor delete images, it is a real shame.
I found this thread which seems to have solved it.
https://stackoverflow.com/questions/74909221/dinamically-create-a-link-using-acf-advanced-custom-field-custom-value/76353138#76353138
But I’m not sure how to implement it
ohhh my bad!
I’m using Admin Frontend plug in, and that adds the feature.
Sorry!!
Thanks for the answer!
Me too! I look all around and didn’t find a way to mix videos and photos.
The workaround of the repeater and a radio checkbox to select video or image… couldn’t make it work.
I see that the gallery field allows loading video, but can’t figure out how to output them. i can only see the images, and the blank space with the url of the video, when I click on it, it just says “the image could not be loaded”.
And here with dynamic poster loaded in an image field (return format URL):
<?php
$link_data = get_field('video_featured');
$link_poster = get_field('poster_image');
if(!empty($link_data))
{
$link = $link_data['url'];
?>
<video width="200" height="300" playsinline autoplay muted loop disableremoteplayback poster="<?php echo $link_poster; ?>" >
<source src="<?php echo $link; ?>" type="video/mp4">
Your browser does not support the video tag.
</video>
<?php } ?>
I’m not a developer, just an enthusiast, so if this can be improved please feel free todo so. Meanwhile I’m so happy it works! 😀
Finally made it work with this one!
<?php
$link_data = get_field('video_featured');
if(!empty($link_data))
{
$link = $link_data['url'];
?>
<video width="200" height="300" playsinline autoplay muted loop disableremoteplayback>
<source src="<?php echo $link; ?>" type="video/mp4">
Your browser does not support the video tag.
</video>
<?php } ?>
Now trying to set the poster via ACF image field. I will keep updating this thread in case someone needs it.
I leave the exact code in case someone needs it
// Prepend shortcode
function https_wa_shortcode() {
return 'https://wa.me/549';
}
add_shortcode('https_wa', 'https_wa_shortcode');
// Append shortcode
function hi_wa_shortcode() {
return '?text=Hi! ';
}
add_shortcode('hi_wa', 'hi_wa_shortcode');
// Post title shortcode
function post_title_shortcode(){
return get_the_title();
}
add_shortcode('post_title','post_title_shortcode');
// Append shortcode
function text_wa_shortcode() {
return ', here is the last part of the text.';
}
add_shortcode('text_wa', 'text_wa_shortcode');
I found a way to do it!
I made 3 shortcodes, one for the “https” part, one for the “whatsapp number” ACF field, and one for the final message.
It works great.
Thanks @hube2 ! I will investigate that option.
@digitalsm thank you so much for your insight!
I was trying to use it as a code snippet (facepalm)
The thing is I use oxygen, so I’ll investigate how can I make this work with posts.
Thanks for your guide! 🙂
Hi @digitalsm this is pretty old, but I’m trying to implement that snippets and always breaks the site.
Is there anything that changed in the recent WordPress updates?
Thanks!
Hi again! Just to give a heads-up to the developers.
It works fine on Firefox. It doesn’t work on chrome or native Samsung internet app.
Unfortunately, I don’t have a way to investigate the dev tools via mobile, but I’m sure it has to be something pretty easy to fix. Or maybe it can be solved with a PHP snippet?
Anyway thanks again!
I see! Thanks @hube2 for the deep investigation and time you take to check this!
I will look into with more detail and get back if I find the conflicting plugin in case someone runs into this problem too.
Thanks again!
Hi @hube2
I believe it is an OS thing.
I was testing in 4 different Samsung devices. Now I borrowed an iPhone and it works fine.
Unluckily most of my users have Android devices 😢🤣
Thanks @hube2 once again!
Indeed, that code now shows the black X, but it is not functional. I touch it on a mobile phone and does not remove the image.
In desktop there is a hover state which turns the X to red, and when clicked, the image can be removed.
This whole idea of allowing the X visible at all tines, is because there is a bug with the mobile version. On iOS when a gallery image is touched, the details screen appears but due to a bad css, the “remove” text is not reachable.
And on Android, touching the image does nothing altogether.
Sorry for being a pain, but I’m struggling with this issue for over a month now.
I can’t seem to find a way to remove images from a gallery via mobile phone. And I really need it.
Thanks!
Thanks @hube2 but to be honest that code is not doing anything in my end :S
Sorry for being asking the same thing in 2 threads, I thought this was not being watched anymore.
But @hopkirk described this problem very eloquently, the fact of the matter if it is currently impossible to remove images from a gallery in a front end form.
I described the specific problem in this thread
https://support.advancedcustomfields.com/forums/topic/show-gallery-remove-icon-not-just-on-hover/
Thanks!
Edited
Thanks again for the reply @hube2
I will try to sum up here the issue I’m facing.
I can not remove images of a gallery via mobile.
I use many css codes and all work fine, this one is not making any change on my end.
I already contacted support, and they were very kind in guiding me. But I keep finding myself unable to simply remove an image from a gallery.
In iOS when I click the image, the details screen shows, but due to css placing I can not click the delete text.
In android phones, touching the pic does nothing.
I don’t want to waste your time, but if I could see a video in which the remove X icons are visible in the mobile version, that’d be great! I assume that is what you were stating in the other thread, right?
Again thanks for your responses!
Hi!
Tried it but no luck, the icon does not show.
I’m using frontend Admin, but I also tested this only with ACF in the backend. And in mobile (using an actual phone) there is no way to remove the images uploaded to a gallery.
I need that feature to allow users to edit their post, which is mainly focused on pics.
I used WP forms a while ago, and they had an X beside every pic, so you could remove it.
Getting back to ACF, the css trick should work right?, but I can not find the exact element to show not only on hover. I tried
.acf-icon.-cancel:hover
a.acf-icon.dark.-cancel:hover
a.acf-icon.dark:hover
Thanks again for the help and guidance!
Hi, I appreciate your time and help!
I’m trying to remove images already uploaded to a gallery.
The upload part works perfectly. But when I try to remove an image from a gallery field, no matter how much I tap on it, the screen which shows the alt text, description and also the “remove” text, never shows up.
I tried logged in or out, I believe it’s just a matter of where the “touchable” part is placed. In Desktop works fine, but in a mobile there is no way to do it.
It’s really hard to think no one else had this problem in all this time. I’m in the same exact spot you are @hopkirk.
I’ve been the last month trying every single frontend form out there and with everyone there is a BIG problem.
With ACF is not being able to exclude terms in the taxonomy list (which can be worked around by using ACF extended) and this gallery in mobile issue, which is really something important.
Just to add up a little more information. From android, it does NOT work. When you tap on an image, nothing happens. From iOS the pop up appears, but because of the CSS misplacing, you can not delete the image.
If anyone has a solution to this, I will be very, very grateful.
You must think I’m kidding, but now I set the priority to 1 and it keeps working.
I will investigate further, but you fixed my problem and I appreciate it very much!
Wow!!!! that worked!!!!
I swear I had no faith in that recommendation because I don’t have any other snippets regarding ACF.
I gave the snippet a priority of 100 and voilà !!
You are a savior @hube2 !!!
Thanks a lot for your time and knowledge!
Hi @hube2 thanks for your response!
Yes, I’m implementing it in a checkbox, but ALL categories keep showing up in the checkbox selector.
What I need is to remove 3 or 4 categories from a field.
I also need to remove a couple of tags from another field. I thought it’d be easy to find a code to filter those out, but I couldn’t find any that work.
Oh! I see, Thanks for the heads up.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.