add third part js to metric theme?

Community Forums Forums General Discussion add third part js to metric theme?

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Lauren @ OnceCoupled 5 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #101711

    fotodog13
    Participant
    Post count: 50

    Hi All,
    I need to add a java script file to the metric theme for call tracking software that this client uses. I am wondering about the best way to add it. This is what I was thinking of doing in the Genesis >theme settings>wp_head() I would add
    <script type=”text/javascript” src=”uploads/callookup/js/lookup.js”></script>

    On the server in my wp-content/uploads directory I would create a folder called callookups that I place the js/lookup.js

    I think this would work but looking for some advice before I do it so I don’t do something thats going to cause a huge problem I am not thinking about on the site.
    As always any help is greatly appreciated- If there is a better way to do this let me know

    ** I still have not really mastered hooks but think this might be something that could be done with that, am I on the right track with that thinking?

    thanks

    Scott V

    http://aiellohomeservices.com
    #101751

    Lauren @ OnceCoupled
    Member
    Post count: 608

    I would enqueue:

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

    Best,
    Lauren


    I do custom WordPress work! http://oncecoupled.com
    Contact me directly: lauren@oncecoupled.com

    #101908

    fotodog13
    Participant
    Post count: 50

    Hi Lauren

    Thanks for the reply-
    So I used enqueue- and added an action hook to my functions php file for that-
    If I look at my source code on the site do you know if I would see the js referenced there.

    I am wondering if I added the enqueue correctly ( site seems to be working correctly )
    I was thinking, or rather hoping that I would see some kind of reference to the js file I added using
    enqueue referenced in the header tag , and I don’t.

    #101969

    Lauren @ OnceCoupled
    Member
    Post count: 608

    If it’s being referenced, it should be visible in your source. What hook are you using?

    //* Enqueue child theme JavaScript.
    add_action( 'wp_enqueue_scripts', 'lgd_enqueue_js' );

    I do custom WordPress work! http://oncecoupled.com
    Contact me directly: lauren@oncecoupled.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.