I am not sure if you posted code as-is or extracted part of it, but per this snippet – you are hooking function inside itself. Which doesn’t seem like it will work nicely. 🙂
Also init
hook should not be used for enqueue, on front-end hook to use is wp_enqueue_scripts
, see where is the right place to register/enqueue scripts & styles.
Example functions.php
code (assuming foundation
is prefix you are using?):
add_action( 'after_setup_theme', 'foundation_after_setup_theme' );
function foundation_after_setup_theme() {
add_action( 'wp_enqueue_scripts', 'foundation_wp_enqueue_scripts' );
}
function foundation_wp_enqueue_scripts() {
// enqueues go here
}
Related Posts:
- How to load css in the footer [duplicate]
- wp_enqueue script my_javascript_file in the footer
- Hook for writing text string after footer scripts
- Add script to footer – on post editor
- Wp_head and wp_footer vs wp_enqueue_script javascript files?
- How do I enqueue a JavaScript in my footer via the functions.php file?
- Getting wp_footer() to work without wp_head()
- How Do I Enqueue a Script into 2 different Footers on the Same Site?
- How do I dequeue a parent theme’s CSS file?
- Check if a script/style was enqueued/registered
- Is it possible to use wp_localize_script to create global JS variables without a specific script handle?
- Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts
- Register a script to be enqueued both in admin and front end
- How can I enqueue protocol relative external (//ajax.googleapis.com/…) scripts?
- Can’t enqueue scripts in the footer?
- How can I remove the site URL from enqueued scripts and styles?
- Loading a script with a dependency, is unloading another script’s dependency
- wp enqueue script using scripts from cdn with a safety callback
- Can I add styles to footer with $wp_styles->add_data?
- Enqueue script in specific page
- How to en-queue bootstrap 4 to theme?
- Notice that the wp_enqueue_style is not being called correctly!
- Hyphens vs. periods in the script slug in wp_register_script?
- jquery script not enqueued in child theme
- Is This The Most Efficient Way To Add Javascript Files?
- Which action to hook wp_enqueue_script to? wp_head or wp_enqueue_scripts? [duplicate]
- Trying to load different syles for 404.php page
- Enqueue Script with URL parameters
- How to use wp_enqueue_style() and wp_enqueue_script() only when needed?
- Preload key requests using wp_enqueue
- How to Add a Custom Script to Customize.php
- Remove specific CSS and JS from the head
- Which are the MediaElement.js scripts to enqueue
- Child Theme – what is the scope of overwriting files?
- Enqueue scripts to footer
- Add last modified time as version to css and js
- Best spot for wp_register_script() and wp_register_style()
- Custom Plugin Development: What priority should wp_enqueue_scripts have?
- Register script/style: Is it possible to customize the version query string via plugin?
- Help with enqueing scripts in footer after init action
- Adding custom fonts (local) to WordPress?
- wp_enqueue_script order – external vs inline js
- Dequeuing scripts for all pages but the home page
- Which jQueryUI handles are predefined in wordpress?
- Modernizr check first, then move on to wp_register_script()/wp_enqueue_script
- How to enqueue a style using wp_enqueue_scripts()?
- Deregister scripts on unnecessary pages using remove_action
- Prioritizing wp enqueue scripts error
- wp_enqueue and Dependencies
- How do you enqueue a Visual Basic script using wp_enqueue_script?
- Why are files enqueued with wp_enqueue_style and wp_enqueue_script 404 Not Found?
- How to place script in footer?
- Enqueue scripts in footer
- jquery-ui-autocomplete is not loaded with wp_enqueue_script
- wp_enqueue_script Doesn’t Work?
- wp localizing script not works
- Is It Possible to add JS AFTER the Enqueue within the same Function?
- How can I manually enqueue plugin scripts
- How to enqueue JavaScript file that depends on CSS stylesheet
- How can I properly enqueue wp-hooks without issues?
- Enqueue customizer scripts that are bundled by webpack?
- Adding multiple wp_register_scripts for templates in WordPres?
- Localizing script to pass a value to a javascript function
- get_template_directory_uri not dependent on WP_HOME in wp-config.php?
- Dequeue script conditonnally
- How do I get jQuery to Load before Bootstrap?
- Conditionally load script depending on current admin page
- Enqueue script inside IE conditional comments
- How can I integrate Fancybox 3 in WordPress properly
- How to enqueue default scripts with dependency?
- Enqueuing a script before anything else
- Should I use get_bloginfo(‘stylesheet_directory’) or get_stylesheet_directory_uri() when enqueueing my js files?
- How to load API’s in WordPress?
- Enqueue scripts based on options
- Adding Pinterest Script Before Closing Body Tag
- Enqueue Script in WordPress
- Plugin add_action and add_menu_page
- how to load css and js based on post template
- How to register script with null value for version?
- link to JS library using wp_enqueue_scripts not working
- Using wp_enqueue_script on scripts that contain PHP
- Enqueue specific script on account creation (and never again)
- Proper enqueue for child theme functions.php
- loading javascript CDN with local fallback (not jQuery)
- How do I pass $in_foooter to wp_enqueue_script() without passing other params?
- Dynamic wp_enqueue_scripts?
- Why do I have to specify all parameters for wp_enqueue_script to load my jquery in the footer? [closed]
- Load scripts only for selected template
- How to do chunked JS files in WordPress?
- wp_enqueue_script error with `ID`, `post_title`, `post_name` of none object
- How to enqueue a script on a specific URL that contains multiple parts
- Enqueue Script only over specific WordPress core file
- wp_enqueue_script silently fails [closed]
- i can’t handle any style or Js file on my theme . what is the problem of this file?
- How to enqueue an external Javascript file to Frontpage footer
- How to include a JS file in this theme?
- wp_enqueue_script was called incorrectly… i want to work with debug on
- Loop through arguments of a function
- wp_enqueue doesn’t load dependencies
- How to give path to files in plugins folder?