using JS to add shortcode to a page

Home Forums Calendar Products Events Calendar PRO using JS to add shortcode to a page

  • This topic has 0 replies, 2 voices, and was last updated 6 years ago by Allan Barush.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1484946
    Allan Barush
    Participant

    I’m trying to add a shortcode via JS like so: $(“#events-holder”).append(‘<div class=”the-events”><?php echo “hello: “.[tribe_events view=”list” category=”fintech”]; ?></div>’); but its not working. do you know if theres another solution?

    thank you

    #1486889
    Andras
    Keymaster

    Hi Allan,

    Thanks for your awesome question!

    This is a tricky thing because shortcodes are usually processed on the servers side, while javascript on the user side (after the server side).

    I found this post which might be helpful for you:

    Adding a shortcode inside of a Javascript InnerHTML

    Let me know if you have any more questions.

    Cheers,
    Andras

    #1507348
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘using JS to add shortcode to a page’ is closed to new replies.