Adding JavaScirpt to with a short code??
-
So I have created a short code that displays some custom coded in a post. I want this short code to also insert some javascript in the head of any page that the short code is placed. Here’s what I have so far.
[Code moderated as per the Forum Rules. Please use the pastebin]
I understand that I could get the JS to appear on ever page by taking
add_action('wp_head', 'validate_js');
out of the shortcode function. But, I don’t want the JS on every page, I just want it on the pages/posts that the shortcode is on. Can anyone help me identify what the problem might be with my code?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Adding JavaScirpt to with a short code??’ is closed to new replies.