How to display ACF URL as button link

Posted in: Newspaper
Post count: 24

Hi,

Does anyone know how do I display/output the ACF > URL field as a button link, instead of displaying its URL in full?

Appreciate someone whom can assist?

Thanks in advance,
yeeloon

Post count: 27744

Hello,

You can use this {cf_youracfname} -> https://i.imgur.com/UHd2l9O.png -> https://i.imgur.com/8OeJHNL.png

Thank you!

Post count: 24

Hi @Anamaria, thank you for your advice. It is really helpful!

I have another question… Now if instead of a button, I would like to use an image/favicon as the hyperlink, how do I do that?

For example, I would like to use a Facebook icon and upon clicking the icon, it leads to the a certain Faceboook page.

Appreciate your advice again. Thanks!

Post count: 27744

Hi,

You can use the button and add only the icon -> https://i.imgur.com/uhqpsx1.png you can add a custom svg -> https://i.imgur.com/oHTRdcJ.png

Thank you!

Post count: 24

Ok got it. Thanks!


@Anamaria
, is it possible for the “cf field” to NOT show or auto-hide the button/icon if there is no URL/link entered into the custom field?

Right now, the button/icon is displaying with the hyperlink pointing back to the default post URL? Please advice. Thanks!

Post count: 21065

Hello @yeeloon !

No. If you do not have any values for the acf fields, then it will display the button.

Thank you!

Post count: 24

In that case, it seems like a bug that needs fixing in the next theme update. Shouldn’t it?

Post count: 21065

Hello @yeeloon !

Please provide a video or some screenshots with the issue you have.

Thank you!

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.