• In HTML, if you want to call a javascript page, it would go in the Header tag and with something like this:
    <script language=”javascript” src=”file.js” type=”text/javascript”></script>

    How do you call a javascript page in WordPress?

    thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Add that same tag to the same location in the your theme’s Header template at Appearance/Editor in the admin panel.

    Actually that is not really the best way to add JavaScript to dynamically generated WordPress pages. Following best practices you should always ‘enqueue’ your JavaScript files. See the codex for more info:

    http://codex.wordpress.org/Function_Reference/wp_enqueue_script

    Just adding in the script as James suggested will probably work fine but it is recommended that you enqueue it. 🙂

    Thread Starter locbtran

    (@locbtran)

    I put tag in the theme’s Header template at Appearance/Editor in the admin panel as you have suggested James but it does not work. I ftp the javascript files into the wp-admin/js and the wp-includes/js folder but still nothing.

    not sure where I am going wrong!!
    thanks

    Thread Starter locbtran

    (@locbtran)

    dgwyer what do you mean by enqueue it??

    See the link given above.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Calling Javascript in WordPress??’ is closed to new replies.