I suspect glob
needs the current working directory to work, so you could try passing the full path of the file to the existing function you have…
include_all_php(dirname(__FILE__).'/includes');
Or set the current working directory first:
setcwd(dirname(__FILE__)."https://wordpress.stackexchange.com/");
include_all_php('includes');
Alternatively you could also use scandir
:
$filepath = dirname(__FILE__).'/includes/';
$files = scandir($filepath);
foreach ($files as $file) {
// match the file extension to .php
if (substr($file,-4,4) == '.php') {include($filepath.$file);}
}
Related Posts:
- get_template_directory_uri pointing to parent theme not child theme
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Include files in child themes, declare in functions.php
- Unable to point the child theme directory even using get_stylesheet_directory()
- Including admin-options.php file in Child Themes
- How to customize the_archive_title()?
- How to override parent functions in child themes?
- remove_action on after_setup_theme not working from child theme
- Adding a second email address to a completed order in WooCommerce [closed]
- Child theme – Overriding ‘require_once’ in functions.php
- Redeclare a function in a child theme
- Include PHP file in Content using [shortcode]
- How to override a function when isn’t at functions.php
- Child theme functions.php do I use php open and close tags?
- Declaring an instance of class included in parent theme from child theme functions.php
- Child theme – overriding add_image_size by a child theme [duplicate]
- syntax for remove_filter in parent theme with class
- Is it possible to override this function/class in a child theme?
- Overriding core functions in child theme
- Override parent theme function that is not hooked or in the functions.php file
- Change parent theme file function in child themes functions.php
- Reuse variable in hook callback
- Child theme – copied some files from parent to child website still uses parent files
- How to override filter in child theme?
- add sidebar area to header of child theme
- Unregister Nav Menu with fallback?
- Child Theme Not Overriding Parent Theme
- Changes to functions.php not working
- Overriding methods in a child theme
- Should I ask a theme developer to use locate_template rather than require_once
- Using the child theme functions.php to change the customizer.php on parent theme
- Overwrite Parent Theme add_image_size in Child Theme
- Proper way of using functions in action hook?
- Twenty Eleven Child theme error when attempting to use a rewritten function
- PHP files included in functions.php don’t seem to work
- How to make child theme inherit parent custom theme options [closed]
- How to remove set_post_thumbnail_size() in child themes?
- Echo tags used to describe the theme
- Child theme within a child theme?
- How can I change a function in a parent theme via a child themes functions.php
- Calling a Function in Functions.php from an external PHP script
- Add other social networks to TwentyNineteen_SVG_Icons class in child theme?
- Why is functions.php file in child not initializing and over-writing parent?
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- Add custom function to a theme with child theme’s functions.php
- Pagination in relation to archive.php
- Impossible to call wordpress function inside an include?
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Load custom css in functions.php causing library issue
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Return child theme url
- wp_star_rating() – Adding a 5 star rating system to theme
- How do I change a parent theme’s function through the child theme?
- How to edit classes in body tag?
- Can’t locate custom image sizes defined by child theme
- Add back in child theme what the parent theme removed with remove_action
- Can’t switch to a child theme using filters template, option_template and option_stylesheet
- How to include any template using Shortcode fuction?
- overwrite code snippet from parent to child theme
- How to edit/replace Parent functions.php function in Child Theme to add “Walker” class
- Child theme function.php causes fatal error
- get_template_directory_uri() links to child theme not parent
- Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme
- How to override this theme function in child theme
- get_template_directory() – references parent theme directory
- Child theme functions.php
- file.php not loaded?
- Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy
- Any adverse effects of adding apply_filters to a function?
- Get webpack to work on child theme
- how can I add filter in specfic field in my website?
- How to remove font awesome from loading in wp theme
- Add custom css file after plugin css with WordPress Child Theme functions.php
- Adding a schema code to one specific page using functions.php file
- How Do I Unhook This Parent Theme Function?
- Widget is displayed in two places
- Child theme, how to cut the functions.php file into several classes?
- Setting Up Child Theme To Take Priority
- How do I create a child theme from PowerMag theme
- Change default color scheme in twentyfifteen child theme?
- Create New User Custom Field not Saving
- How would I correctly implement a new if statement in a child functions file?
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Child Theme not loading multiple stylesheets
- Modified functions.php in Magazine Pro theme of Genesis. 500 error
- Help with is_page() and calling css for specific pages in a Child Theme
- How do I integrate my Child Theme into a Custom Template?
- Getting back a blank WordPress site following functions code edit
- Adding a meta box fields to child theme options page
- Child Theme functions.php has no effect
- Preventing PHP Execution in Parent Theme
- Blank child theme – functions.php problem
- Why does my visual post editor break when I try to add a TinyMCE button?
- Unregistering custom tinymce plugin?
- Override parent theme function that is not hooked or in the functions.php file
- Undo a function that is not (seemingly) hooked to an action?
- Problem with Child-Theme using of foundation-framework [closed]
- Why functions metaboxes is causing White Screen in Admin [closed]
- How do I make my child theme’s CSS update when I save it?
- post_row_actions filter from parent theme not executing in child theme