wp_enqueue_script adds only the first script

You gave each each script the same handle/id of ‘grid’ Try something like this. function banana_scripts() { wp_enqueue_script(‘grid’, get_stylesheet_directory_uri() . ‘/js/jquery.min.js’, null, null); wp_enqueue_script(‘grid2’, get_stylesheet_directory_uri() . ‘/js/main.js’, null, null); } add_action(‘wp_enqueue_scripts’, ‘banana_scripts’);

Add Item to Custom TinyMCE Menu

addMenuItem() adds to tinymce’s toolbar, which isn’t used by WP by default, and uses context to add to the particular (sub)menu. You’re adding a MenuButton, and you can access the button through the editor’s buttons array, keyed by the button name: add_action( ‘admin_print_footer_scripts’, function () { ?> <script type=”text/javascript”> jQuery(function ($) { tinymce.on(‘SetupEditor’, function (editor) … Read more

Javascript not working?

The “Failed to load resource” is probably a red herring and isn’t related to your issue. The fact that it is throwing an error about the $ shortcut means your js file is being loaded correctly. The likely issue is that jQuery in WordPress loads in “noConflict” mode. As such the $ shortcut will not … Read more

How to replace a javascript select box onchange event to a form submit action?

It’s not working because: You are redirecting home You don’t listen for the $_GET variable so the archive link is just appended to your home url You need to add a function that listens for that $_GET variable. just add this to your functions.php file add_action( ‘template_redirect’, ‘wpse_archive_select’ ); function wpse_archive_select(){ if( isset( $_GET[ ‘archive-dropdown’ … Read more

Create user from outside WordPress through api?

This does not use the API, but it’s a script I’ve used a hundred times over the years, always works. Simply drop it in the root of your install and then access the file directly. Remember to delete the file immediately afterward. I do not remember where I originally obtained this script. <?php // ADD … Read more

The value of attribute [ data-type ] must be in double quotes – custom html widget error

change it to CSV data-type=”Information Gathering, Farming & Husbandry, Delivery Service, Emergency Response, Remote Inspections, Mapping & Surveying, Maritime Success, Military & Defense Support, Scientific Research, Real Time Surveillance ” then do var toRotate = elements[i].getAttribute(‘data-type’).split(“, “); the .split(“, “) turns the CSV string into an array. then do new TxtType(elements[i], toRotate, period); the toRotate … Read more

wp_register_script unable to link bootstrap JS

function load_js() { wp_register_script(‘bootstrap’, get_template_directory_uri() . ‘/js/bootstrap.min.js’, array(‘jquery’), false, true ); wp_enqueue_script(‘bootstrap’); } add_action(‘wp_enqueue_scripts’, ‘load_js’); Use with array(‘jquery’) instead of ‘jquery’ Refference here. It says: use array.