Support

Account

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 🙂