Javascript buttons not working
-
Hi
Hoping someone can help with this.
I want to add a javascript button to a page which will link to one of 8 random other pages.
I have the javascript worked out. When I add it in code view on the actual page it shows the button but the button doesn’t work when clicked.
I believe I may have to have this script enqueued somewhere but all the documentation I am reading relates to making themes or plugins (neither of which I am doing)
How can I just get this single button to work on this single page?
This was what I have ready to go into my functions.php
add_action('wp_enqueue_scripts', 'studydesign_enqueue'); function studydesign_enqueue() { if (is_single('study-display')) { wp_enqueue_script( 'studydesign', plugin_dir_url(__FILE__).'study-design-js.js' ); } }
Any help is gratefully received
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Javascript buttons not working’ is closed to new replies.