Putting aside the question of what should and should not be part of a theme, I don’t see why something like this wouldn’t work with a child theme. Use get_stylesheet_directory
, which will return the child theme path if it exists and otherwise will return the parent path, to build the path for scandir
and I don’t see the problem.
Related Posts:
- How to properly dequeue scripts and styles in child theme?
- Child Theme – what is the scope of overwriting files?
- Including style.css in Child Theme
- Including files in Child Themes
- When should I use wp_register_script() with wp_enqueue_script() vs just wp_enqueue_script()?
- How do I dequeue a parent theme’s CSS file?
- Check if a script/style was enqueued/registered
- Cannot deregister a script using wp_deregister_script
- How to dequeue / deregister any theme styles and scripts
- Hyphens vs. periods in the script slug in wp_register_script?
- jquery script not enqueued in child theme
- enqueue and localize script in footer
- Adding Custom Javascript to Skeleton Child Theme
- How to Add a Custom Script to Customize.php
- wp_enqueue_script vs. wp_register_script
- Best way to enqueue extremely popular scripts like bootstrap and font awesome
- How to dequeue / deregister parent theme style
- Best spot for wp_register_script() and wp_register_style()
- wp_enqueue_script with dependencies doesn’t work
- Register script/style: Is it possible to customize the version query string via plugin?
- Help with enqueing scripts in footer after init action
- Modernizr check first, then move on to wp_register_script()/wp_enqueue_script
- How do I get a child theme to load scripts from the parent theme?
- WP .js script file not loading
- How to cancel `wp_print_scripts`?
- getting a js file for one page
- Can’t see why my scripts aren’t loading when I register and enqueue them
- WordPress script file version numbers changing in live environment
- How to create a child theme with multiple css files.
- Change script type and src of plugins in theme
- How to enqueue JavaScript file that depends on CSS stylesheet
- Adding multiple wp_register_scripts for templates in WordPres?
- Localizing script to pass a value to a javascript function
- Enqueuing script is adding extra text for google maps [closed]
- get_stylesheet_directory() in child theme breaks parent scripts
- Deregister multiple scripts using a function?
- wp_enqueue_scripts does not work
- wp_enqueue_style referencing parent theme
- If a Script has been enqueued but not registered can I still removed it?
- include jquery plugin file not working
- How to use wp_register_script / wp_enqueue_script for multiple queries
- How to register script with null value for version?
- Using wp_enqueue_script on scripts that contain PHP
- Stop a plugins js and css from loading on all pages and show up only where it is called
- Enqueue registered dependencies only when necessary
- How to get, in WP page’s script, a wp enqueued script (in Functions.php)?
- css3-mediaqueries-js failing with child theme
- wp_enqueue doesn’t load dependencies
- Why do WordPress adds the id=”handle-{js|css}” attribute to scripts and stylesheet?
- Dequeue/deregister scripts for everybody but the administrator
- Is it possible to use wp_localize_script to create global JS variables without a specific script handle?
- 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?
- Enqueue script in specific page
- How to en-queue bootstrap 4 to theme?
- Notice that the wp_enqueue_style is not being called correctly!
- Is This The Most Efficient Way To Add Javascript Files?
- wp_register_script multiple identifiers?
- Trying to load different syles for 404.php page
- Enqueue Script with URL parameters
- Remove specific CSS and JS from the head
- Use js script from one plugin in another plugin
- Which are the MediaElement.js scripts to enqueue
- Adding jQuery dependency prevents my script from enqueuing/loading
- Adding custom fonts (local) to WordPress?
- wp_enqueue_script order – external vs inline js
- Is my child theme working properly
- Deregister scripts on unnecessary pages using remove_action
- Prioritizing wp enqueue scripts error
- wp_enqueue and Dependencies
- Adding tawk.to code just before body tag on functions.php file
- Why are files enqueued with wp_enqueue_style and wp_enqueue_script 404 Not Found?
- Loading scripts with wp_register_script and wp_enqueue_script
- wp_enqueue_script Doesn’t Work?
- wp localizing script not works
- Is there a way to check for an attribute of a script when using script_loader_tag?
- Enqueue customizer scripts that are bundled by webpack?
- How do I get jQuery to Load before Bootstrap?
- call my script only after loading UI library?
- admin_enqueue_scripts not rending JS file correctly
- How Do I Enqueue a Script into 2 different Footers on the Same Site?
- how to load css and js based on post template
- link to JS library using wp_enqueue_scripts not working
- Enqueue specific script on account creation (and never again)
- Proper enqueue for child theme functions.php
- loading javascript CDN with local fallback (not jQuery)
- Dynamic wp_enqueue_scripts?
- Why do I have to specify all parameters for wp_enqueue_script to load my jquery in the footer? [closed]
- Page not found when trying to link to files in child theme directory
- Load scripts only for selected template
- Can’t seem to get javascript code working from child theme
- Enqueued script fails
- wp_enqueue_script error with `ID`, `post_title`, `post_name` of none object
- WordPress core jquery version file not loaded?
- How to enqueue a script on a specific URL that contains multiple parts
- wp_enqueue_script silently fails [closed]
- wp_enqueue_scripts doesn’t work for template pages
- WordPress | enqueue_scripts in a child’s theme returns error
- How to give path to files in plugins folder?