Created
November 16, 2021 09:10
-
-
Save davidverhage/790a288e3abef9ad59c6ba25a47e8994 to your computer and use it in GitHub Desktop.
Wordpress Tip: keep your function.php file clean
This file contains 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 | |
//Loading all php files from the functions/ folder | |
//this keeps your wordpress functions file clean | |
//and you can split up your function build up by parsing functionality in different files. | |
$folder = get_template_directory()."/functions/"; | |
$files = glob($folder."*.php"); // return array files | |
foreach($files as $phpFile){ | |
require_once("$phpFile"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment