Home › Forums › Front-end Issues › Shortcode in Url ? › Reply To: Shortcode in Url ?
Hi @aleccs
Here’s an example how to do it:
$my_number = get_field('mynumber');
echo do_shortcode('[add_to_cart_url id=' . $my_number . ']');
Please keep in mind that you need to put it inside The Loop.
If you have time, please learn more how the template works here: https://codex.wordpress.org/Theme_Development.
If you don’t have time to learn it, I suggest you hire a developer to help you out with it, and I’d recommend looking for one on https://studio.envato.com/ or https://www.upwork.com/.
I hope this helps 🙂
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.