• Resolved bodieq

    (@bodieq)


    Hey Matt!

    Super excited to find your Font Awesome plugin for ACF. Thanks for all your work developing it. Sorry for the newb questions, but here goes. Answer as you see fit.

    Obvious Question: Do I need to set up a separate Link field in ACF to link the icon to where it needs to go? I don’t see this setting within the Font Awesome fields, so I am assuming yes.

    Have I done this right below? Right now I have a true/false field that says, if checked:

    1) Show Font Awesome Icon and select icon style
    2) Show Link field where I input the URL.

    Is this how I should be doing it?

    Ok second part…

    I am using Beaver Themer’s built in ACF function to pull the data to the front. They give the following conditional example for an image:

    [wpbb-if post:acf type="image" name="corp-photo"]
        <div class="fl-post-feed-image">
        	<img src="[wpbb post:acf type='image' 
                   name='corp-photo' image_size='thumbnail']"/>
        </div>
    [/wpbb-if]

    I just didn’t know the “type” of your plugin (as used above) ? Is it “font_awesome_icon“? “font-awesome-icon“?

    Basically I am trying to say “display the icon (linked correctly) only if the box is checked”. I just know what to put for “type” and if I needed any other parameters.

    Sorry this was long! Hope it makes some sense.

    (The attached link is where I want the conditional social icons to go on my page, just for reference)

    • This topic was modified 7 years, 6 months ago by bodieq.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Matt Keys

    (@mattkeys)

    Yes if you are linking the icon somewhere, and the editor needs to be able to decide that URL, you should use another ACF field to gather than input from your editor.

    I haven’t used beaver builder very much, so I am not positive what that code is doing, but I would guess the ‘type’ of my field is: font-awesome. That is the name that I register with ACF when the field is created.

    Thread Starter bodieq

    (@bodieq)

    Perfect! Thanks for the fast response.

    I just wanted to be sure that I was linking the icon properly. So if I put the Font Awesome Icon and the Link dependent on the True/False visibility, does that mean that ACF knows that the link goes with the icon?

    As far as the shortcode, I think I can get it now. Thanks so much! Here goes nothing!!

    Plugin Author Matt Keys

    (@mattkeys)

    So if I put the Font Awesome Icon and the Link dependent on the True/False visibility, does that mean that ACF knows that the link goes with the icon?

    No, it will be up to you to pull the value of the link and put it in the href of your A tag element, and to wrap that A tag element around your icon (assuming that is the goal).

    If there is always supposed to be a URL when an icon is used, you could make both of those fields required, and they will only *actually* be required if they are visible based on the conditional logic of your true/false field.

    Thread Starter bodieq

    (@bodieq)

    Thanks Matt!

    This is such helpful feedback, thank you!

    pull the value of the link and put it in the href of your A tag element, and to wrap that A tag element around your icon (assuming that is the goal).

    Do you have any example code you could point me to of what we are talking about? I am so much better at reverse-reverse-engeneering code instead of writing it myself!

    Many, many thanks!

    Plugin Author Matt Keys

    (@mattkeys)

    The docs at the Advanced Custom Fields site are actually great for that kind of stuff, I often refer to them.

    https://www.advancedcustomfields.com/resources/link/

    You will find some example code there about the link field. You can find other helpful guides here: https://www.advancedcustomfields.com/resources/

    Thread Starter bodieq

    (@bodieq)

    Ok sounds good. Really appreciate the help and guidance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Basic Help Getting Going / Adapting Beaver Themer Shortcode’ is closed to new replies.