wp_enqueue_scripts
is a PHP hook, so you should use it in PHP. It won’t work, if you add it to some JS file.
So if it’s not a typo and you really put this code to functions.js
file, then that’s the reason it doesn’t work.
Related Posts:
- wp_enqueue_script being ignored in custom theme
- Getting jquery to work with custom theme
- Adding wp_enqueue_media(); causes problem
- Including Javascript options
- jQuery not available to other scripts
- how can i remove js file from my footer in wordpress
- enqueue script if page is not equal to
- Theme now uses require.js and enqueue script no longer works
- ajaxurl not defined on front end
- How to include jQuery and JavaScript files correctly?
- pass object/JSON to wp_localize_script
- How to enqueue script if widget is displayed on page?
- Why I can’t add a CSS style in this WordPress theme?
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- jQuery in header or footer
- Is there a way to set the order of wp_footer hooked functions?
- How to alter the text of the post “Excerpt” box label in WordPress post editor?
- What can I hook into after_setup_theme?
- What does “Do not deregister the jquery script in the administration area” mean?
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- How do you enqueue script tags for ReactDOM in WordPress’ functions.php?
- WordPress Enqueue Script Chaos (jQuery & Foundation.js)
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- using wp_enqueue_script to attach jquery-ui
- How to Change CSS Variable value in Theme Customizer Live Preview
- WordPress Google Maps in Custom Theme
- Enqueued Stylesheets Effecting Admin Styles
- Is it safe to enqueue a font style without putting http or https?
- How to correctly add JQuery in a WP theme?
- Toggle Sidebar Display
- Is there a filter for enqueue script to strip the type=”text/javascript” property
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- Fancy-box Esay wordpress plugin fails to work on Multilingual site
- Is my approach to enqueue styles inefficient?
- functions.php not hooking up with style.css
- way to include own functions independent of theme
- How to To Filter wp_enqueue_script() Scripts on Some Pages
- WP 3.1 upgrade breaks AutoFocus+ theme
- How to add Bootstrap Tour JavaScript to WordPress Admin Panel Dashboard Widget
- My javascript jquery won’t work?
- Implementing FancyBox
- Can´t access child theme´s scripts dependencies found in parent
- How to: JQuery multiple wordpress media uploader buttons in the same options page?
- How to modify default controls in WordPress theme customizer
- How to enqueue javascript for WP Customize options sidebar?
- Post thumbnail to append post content via ajax click event
- Would to use AJAX to get an option from the database and use it in a jquery setup or is there an alternative to consider?
- Using page-id-{ID} from body_class() in local dev, versus live staging
- My jQuery is enqueued properly. So why isn’t it working?
- Custom theme, contact form 7 & fast secure form doesn’t work
- Enqueued JavaScript is not working
- WP Plugin Running before jQuery
- Javascipt issue on custom theme
- Overide enqueue in non plugable function via child theme
- How to make javascript work on theme options page
- How to register and enqueue JavaScript files without breaking plugin dependencies?
- JQuery undefined and Stylesheet loads in bottom along with js files
- Weirdness in jQuery supplied with WordPress
- How to fix : Uncaught ArgumentCountError: Too few arguments to function? [closed]
- How to enqueue a script which is type module without using script_loader_tag filter?
- Using function from enqueued .js file in theme in plugin?
- jQuery from parent theme loaded with many other scripts in a single min.js file
- Custom jquery not code not working in wordpress
- Trouble in enquing all js files under certain directory
- add jquery file if a certain page is included
- How do I implement jPanelMenu?
- loading javascript after jquery is loaded
- MapPress Easy Google Map in Jquery Tabs Problem
- I don’t think WordPress is loading jquery or bootstrap js
- Adding google fonts to WordPress theme
- How to properly use AWS SES for a contact form?
- Bootstrap slider not working
- Find out the reason that the Styles and scripts in the theme are loading properly in localhost but Not in server after deploying
- Embedding CodePen Calorie Script – jquery error
- How to load jQuery with Ajax in WP version 5.3.2?
- How to enqueue scripts properly with ES6 webpack?
- WordPress core jquery version file not loaded?
- Infinite scroll without plugin using ajax
- change background image on scroll
- Enqueue script for development purposes only?
- Correct was to customise theme using get_theme_mod in scripts
- how to add jquery to wordpress
- how can I re-utilize and class on a child theme
- jQuery conflict in WordPress, works fine in HTML
- How would I get this to work – send to post from thick box
- How do I get my theme scripts to load in a custom theme built from Bootstrap
- FitVid not working for iframes on particular theme install
- Enable WP to accept standard jQuery code embeding between the tags [duplicate]
- WordPress custom jquery not found
- Passing a location-dependent array via wp_localize_script within a shortcode
- Set start page depending on screen width [closed]
- WordPress Subpages Fancybox Trouble
- Enqueue script/style with multiple GET parameters
- can’t add EVENT LISTENER to a element
- jQuery Snippet Not Working on WordPress Site [closed]
- WP Customizer get control value on change
- Execute javscript when theme customizer loads (autosave issue)
- WordPress Includes mejs 404 error
- Add social icons in a theme through custom admin menu
- Double jQuery loaded