I am using elementor but i was using the ACF shortcode like you use it in wordpress so elementor isnt a problem.
Im new to ACF, so i was trying to understand how to create a clickable link. Looking at the field types in ACF, URL looks like the one you use for someone to fill in a url and then on the front end it appears for someone to click on.
But looking at your answer on the post i linked, it seems otherwise, plus your answer saying…
“Just a little off topic, but I don’t use URL fields much. I basically always use a text field. URL fields are too limiting. I want to allow users to enter any valid href value, so I use a text field and then add custom validation to to it.”
So reading the original post and then your reply to it, sounds like you use a text field with some custom code to allow users to fill in a url in the backend for it to display on the frontend of the website and allow visitors to click it, am i right in thinking this?
I came across this problem which is similar to what i want to do and you talk about using a text field with custom validation. So do your text fields contain a url that a user puts in, which the url is displayed on website frontend and is also clickable/linkable to the relevant url?
How do i achieve that?
Ok, so what is the “URL” field type used for in ACF? Should i be using something else?
Is there a shortcode already setup to do what i am trying to achieve?
In ACF I have a field with “url” as the type.
Which then appears in the custom post for the user to put in a url.
Then on the page, which is built with elementor, I am using ACF shortcode to display the url as I couldn’t do it via the normal way in elementor.
I was told to put the shortcode in an <a href but it didn’t work or only half works.
a href=”<?= website(‘my_link’) ?>”>[acf field="website"]
I am guessing the “my link” bit would be the url but I don’t want to manually put that in each time. So at which point I got stuck.
I would like the url to display as it does and then link to the site.
managed to sort the comma, but how do you get the URL to display or link correctly?
https://www.cider.ordesign.me/member/barbourne-cider/
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.