Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #80355

    Joe R
    Participant

    Is there an easy area to insert additional scripts? I’ve added the google analytics to the “Customer” section of the customizer, but I don’t know where to add additional scripts.

    Here’s the code I need to add:

    <!-- Wikplayer http://www.wikplayer.com -->
    <script type="text/javascript" src="http://www.wikplayer.com/code.js" 
    data-config="{'skin':'skins/wikfull/plainBlack/skin.css','volume':36,'autoplay':true,'shuffle':true,'repeat':0,'showcomment':false,'marqueetexton':true,'placement':'top','showplaylist':false,'playlist':[{'title':'Walkin','url':'www.website.com%2FmusicSongs%2Fwalkin.mp3'},{'title':'(SAMPLE)%20Canon%20in%20D%20-%20Pachelbel','url':'http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMK6heUdRr-E'}]}" ></script>
    <!-- Wikplayer code end -->

    I realize this isn’t a part of your theme, but just wondering if you can tell me where I would add it.

    Thanks!
    – Most recent WordPress version.
    – Ethos Stack
    – original shortcode plugin

    #80379

    Paul R
    Moderator

    Hi Joe,

    You can add additional javascripts in customizer page > custom tab > Javascript.

    http://screencast.com/t/bMzPS7ZOy5QM

    Thanks

    #80626

    Joe R
    Participant

    I’m glad I’m looking in the right area. Can I still use the code referenced above since it requires the use of the <script...></script> code?
    When I added the google analytic code, I had to remove the script tag to get it to work.

    Thanks again!

    #80645

    Cousett
    Member

    Yes just do not include the tags <script> just add everything that is inside that script tag. I hope this helps.

    #81405

    Joe R
    Participant

    Support,

    Last question. What if the entire block of code is written within the <script tag? I realize this isn’t your code, but I don’t know enough about this to figure it out.
    Here’s the actual code so you can see what I mean:

    
    <!-- Wikplayer http://www.wikplayer.com -->
    <script type="text/javascript" src="http://www.wikplayer.com/code.js" 
    data-config="{'skin':'skins/wikfull/plainBlack/skin.css','volume':36,'autoplay':true,'shuffle':true,'repeat':0,'showcomment':false,'marqueetexton':true,'placement':'top','showplaylist':false,'playlist':[{'title':'Walkin','url':'www.website.com%2FmusicSongs%2Fwalkin.mp3'},{'title':'(SAMPLE)%20Canon%20in%20D%20-%20Pachelbel','url':'http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMK6heUdRr-E'}]}" ></script>
    <!-- Wikplayer code end -->

    Is this block of code even compatible with your theme?

    And THANK YOU for all your help and an absolutely amazing theme!

    #81409

    Kosher K
    Member

    Hi Joe,

    Sorry for the confusion, linking an external Js cannot be added in Customizer,

    However, If you’re using a child theme you can actually add a script like below,

    Add this code in your child theme functions.php file.

    function my_additional_js() { ?>
    <!-- ADD your Script Below THis line-->
    
    <!-- Do not add anything Below This line-->
    <?php 
    }
    add_action('wp_footer','my_additional_js');

    Simply add your script below the first line I commented,

    Hope that helps.

    Cheers