Adding javascript to header of MetroMagazine theme

Don’t edit theme files. Your changes will be overwritten when your theme updates. Instead use a child theme and hook into the wp_head function. Add this to your child theme’s functions.php file. function add_js() { ?> <script> Your JavaScript goes here </script> <?php } add_action(‘wp_head’, ‘add_js’); BTW, as you have a commercial theme, you can … Read more

How to use value from modal tinymce windowManager?

If I read your question correctly, this is more related to Javascript programming than WordPress. To get the selected option value or text of a HTML select tag, use: var e = document.getElementById(“programming-language-id”); var value = e.options[e.selectedIndex].value; //your code doesn’t set option value var text = e.options[e.selectedIndex].text; //this will get the selected option text

adding script tag in head of specific pages

A simple google search can help you do this, well same question was answered before, you can see the answer here. Use WordPress methods in your functions.php to do this : function load_scripts() { global $post; wp_register_script( ‘home’, get_template_directory_uri() . ‘/js/home.js’, array(‘jquery’)); wp_register_script( ‘about’, get_template_directory_uri() . ‘/js/about.js’, array(‘jquery’)); wp_register_script( ‘somepost’, get_template_directory_uri() . ‘/js/somepost.js’, array(‘jquery’)); if( … Read more

Adding javascript script to header via functions.php

I just opened your website and checked your crypto.js is successfully embeded in your head. But you have some errors in your code that’s is why it’s not working. Here is the code which i have found in your file. jQuery(document).ready(function() { <script type=”text/javascript”> baseUrl = “https://widgets.cryptocompare.com/”; var scripts = document.getElementsByTagName(“script”); var embedder = scripts[ … Read more