Last active
December 19, 2015 19:08
-
-
Save decodigo/6003423 to your computer and use it in GitHub Desktop.
Loop through a widgets directory and dynamically include them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Loop through each file in the Widgets directory and include it. | |
foreach ( glob( get_template_directory_uri() . "/widgets/*.php", GLOB_NOSORT) as $filename ){ | |
include $filename; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment