You need to use some recursion on the function:
function require_all_files($dir) {
foreach( glob( "$dir/*" ) as $path ){
if ( preg_match( '/\.php$/', $path ) ) {
require_once $path; // it's a PHP file so just require it
} elseif ( is_dir( $path ) ) {
require_all_files( $path ); // it's a subdir, so call the same function for this subdir
}
}
}
require_all_files( get_template_directory() . "/Functions_Folder" );
Related Posts:
- Merging PHP download script into `functions.php`
- How to first edit in local WordPress editor on page and the add code?
- Alternative to file_get_contents() for theme operations
- How to add posts to custom menus?
- How to add custom css file in theme?
- CSS not updating in browser when I change it
- How to remove search bar from a wordpress theme? [closed]
- Get url of thumbnail from the media uploader
- How to: Update live sites theme from version control repo via plugin or library? [closed]
- Best practice way to implement custom sections into a WordPress theme
- Adding items to page template dropdown on Page Edit Screen
- How to use logout function on custom menu link?
- How to customize wordpress login/register pages?
- Front End Post Submit Form
- Page attribute template dropdown not displayed even the syntax is correct
- How to add a text widget during theme activation
- WordPress Theme customisation CSS
- Why does this loop only work on the homepage?
- Nesting Functions within Functions
- De-registering parent style sheet css recommended?
- inserting custom li class to wp_list_pages
- Theme check: Missing a text-domain
- Can I customize any WordPress parent block-based theme template files by child theme like a parent classic theme?
- How to determine if post has widget content?
- Custom Script Section Only Echoes Text
- Free starter theme to make mobile websites? [closed]
- WP Customize refresh problem
- Set multiple templates per post
- Place the page title into the short code
- My javascript jquery won’t work?
- Displaying recent post excerpts on static front page
- How to check if a WordPress core block is active in sidebar
- approach to pass additional parameter in post URL
- Which html elements should be styled in wordpress theme
- wp_remote_get times out on api request but jquery GET and postman work?
- Folder name for a pro version of a WordPress.org theme?
- WordPress Media Uploader in page template (On Front-end)
- Using WordPress’ Theme Customizer to select page templates that update layout in the preview
- Theme Customizer not loading JS for live preview
- Replace function in a child theme
- get_search_form() and aria_label
- Can’t remove DIV from hooks in Storefront child theme [closed]
- How to register and enqueue JavaScript files without breaking plugin dependencies?
- How can I specify that an area of my theme contains widgets?
- Extract all shortcode data from post into loop variables?
- wp_nav_menu and its fallback
- Adding the_content() return warning count()
- Copying the theme style files and images to duplicate the website but with a difference
- How to enqueue a script which is type module without using script_loader_tag filter?
- How to set Post meta-box defaults based on the choices made by user in Customizer?
- Should is_active_sidebar() always be used around dynamic_sidebar()?
- How do I include a partial from a directory below a wordpress theme directory?
- Ajax call returns 0 when add_action is inside a class in functions.php
- Woocommerce Product attribute not imported with wordpress Importer [closed]
- WordPress Comment spam issue
- Is it possible to have a Theme with built-in physical page files?
- header, stylesheet not being read
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- questions of submit wordpress theme [duplicate]
- List categories of a post hierarchically?
- Custom Post Types set up, how do I style the main slug page?
- What are the permalinks options for “Category” base and removing it?
- Designing a custom archive.php inspired by the Autofocus theme
- Is a site with 1,500 pages, (1000 of which are E-Commerce Pages) Too Big to Migrate to WordPress?
- How to get blog-id of an MU site from functions.php
- How to add wysiwyg editor in customize screen using customize_register
- How to register dynamic settings in WordPress Customizer?
- How to add audio files to audio player in WordPress custom theme?
- WordPress theme doesn’t read my translations from pt_BR.po file
- Data Validation & Sanitization for Big HTML Blocks
- Move the social media icons to the left of a WordPress nav menu for Soledad child Theme
- Need help with adding custom wordpress menu and sub-menu
- get currently showed author ID in theme functions.php
- WordPress Custom font not found
- How do I control the header space in non-front pages in Twenty Seventeen?
- Target second from last post in loop
- How to load mediaelement.js in theme template?
- Full width thumbnail
- Customizer API way function is_customize_preview() works only in main page?
- Advantages/Disadvantages Using Theme Editor Instead of Pages
- Magnific Popup – Add Caption to Images
- Why do WordPress developers use so many opening and closing PHP tags when developing themes? [duplicate]
- using theme check plugin to remove waring and errors from my theme
- paragraph format in WYSIWYG on a custom theme?
- unable to display the image meta value as background
- editor style css and page template with and without sidebar
- 3 x 3 grid of posts on the home page
- Suppress the_content filter in a nested loop
- The normal loop with different styles doesn’t work in search.php
- Pass custom css class to add_menu_page
- URL conflict with a ‘Single Page Layout’
- loading custom.js file after jquery is loaded
- How to force unlink on attached/inserted images?
- How to determine if it is legal to remove credit link from theme?
- Display recent posts on front page
- How to create sub-menu in “Allure Real Estate Theme for Placester”?
- Feeds are showing where Post archive page should be
- My wordpress site memory exhausted more than 1GB trying to debug with default
- WordPress Two Level Filters on Getting Custom Taxonomy Terms
- I want to resize post featured image without cropping image. How?