How to add a javascript to a specific wordpress page?

by ronr
3 replies
  • WEB DESIGN
  • |
I have a date javascript that lets you set a rolling advance date for several days ahead and display the results.

For example if you came to my webpage today , you could have on your wepage, return by Friday Dec. 16th and I'll include a bonus..

It works fine on an HTML page but not on on a Wordpress page. I've searched for different solutions but I can't figure them out.

Any suggestions?

Thanks, Ron
#add #javascript #page #specific #wordpress
  • Profile picture of the author mgreener
    Hi,

    To use it in a Wordpress post, place all of your JS in a file, then link to it in the post like this:

    <script type="text/javascript" src="yourfile.js"></script>

    And then place the action after that such as onClick="yourAction();"
    {{ DiscussionBoard.errors[5224023].message }}
    • Profile picture of the author ronr
      Thanks for the suggestions. I tried the plugin and it worked.

      Originally Posted by mgreener View Post

      Hi,

      To use it in a Wordpress post, place all of your JS in a file, then link to it in the post like this:

      <script type="text/javascript" src="yourfile.js"></script>

      And then place the action after that such as onClick="yourAction();"
      {{ DiscussionBoard.errors[5224601].message }}
  • Profile picture of the author RobKonrad
    Or, use this plugin

    WordPress › Raw HTML « WordPress Plugins

    Cheers,
    Rob
    Signature
    ================================================== ===
    This blog is awesome: http://www.robkonrad.com/blog. Read it.
    ================================================== ===
    {{ DiscussionBoard.errors[5224084].message }}

Trending Topics