I’m trying to hide the social media icons in the site footer based on whether or not there are Values for each corresponding social page in an ACF Options Page (see attached).
I use more the pinegrow theme converter, but probably it is exactly the same on WordPress builder. There is a if checkbook right where you link the content with the field.
@sirojuntle I appreciate the reply. I don’t think this is what I need though… I’m not using the Block Smart Actions - Block Attributes that has the “If” checkbox. See attached.
Select the element and add the first Conditional option: “if options”
In the “if options” panel field, just put get_field('instagram') replace the instagram with whatever is the name of the field you created in the ACF.
(If it work) Repeat it one by one changing the field name.
The block conditions may work, but it is new for me. You could test to follow the first video where they tell how to show or not a h2 title if it has a link. If your theme does not generate a <a anchor> automatically, it should work too, but I guess the above suggestion might be more simple and clear).
Wasn’t quite what I needed but it got me to the right destination.
Here’s what worked (in case anyone else needs this that doesn’t naturally know the solution and doesn’t want to spend hours on something that should have taken minutes…)
On the parent element, in my case the link element, you place 2 actions:
Action #1: “Display ACF Field”. For the Field value, use the value you created in ACF. For Object ID, be sure to use “Options” if you’re using the ACF Option setup like I did. Then in my case I was switching out the Href attribute, so that’s what I selected for Replace.
Action #2: “If Options” conditional (the 1st one under “Conditionals”. You need to then use get_field( 'youtube_link', 'options' ). The “get_field” part is to get the ACF field. The first value in the parenthesis is the same name of the field for Action #1. Then you have to have the ‘options’ bit in there otherwise it won’t work. My guess is that it’s not pulling from the “ACF Options” page and probably looking for an ACF field on the page/post by that name, which doesn’t exist.