-
AuthorPosts
-
August 8, 2014 at 12:39 am #80355
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 pluginAugust 8, 2014 at 2:11 am #80379Hi Joe,
You can add additional javascripts in customizer page > custom tab > Javascript.
http://screencast.com/t/bMzPS7ZOy5QM
Thanks
August 8, 2014 at 9:30 am #80626I’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!
August 8, 2014 at 9:46 am #80645Yes just do not include the tags <script> just add everything that is inside that script tag. I hope this helps.
August 9, 2014 at 3:30 pm #81405Support,
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!
August 9, 2014 at 3:43 pm #81409Hi 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
-
AuthorPosts