WordPress.org

Ready to get started?Download WordPress

Forums

Responsive
[resolved] Recommended way to include a JavaScript file (3 posts)

  1. MineForeman.com
    Member
    Posted 1 year ago #

    Hi All,

    Can anyone tell me the recommended method to include a new JavaScript file with the Responsive Child Theme?

    I have done a Google and found about 9 different ways so I thought I would come straight to the horses mount and ask here.

    The method I like the most is to add a functions.php to the child theme and put;-

    <?php

    function myJS_link() {
    echo '<script language="javascript" src="JavaScriptFileName.js">
    </script>' . "\n";
    }
    add_action( 'wp_head', 'myJS_link' );

    Is that a good way of doing it?

    Thanks heaps

    Neil

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Here's the WP word on it

    http://codex.wordpress.org/Using_Javascript

    But you may also want to look at Responsive's dedicated forums as Emil always has really great help for his themes:

    http://themeid.com/forum/

  3. Emil Uzelac
    Theme Review Admin
    Posted 1 year ago #

    Create a functions.php in your Child Theme and see this paste please http://pastebin.com/iUynbySg

    Emil

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic