-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
36 lines (31 loc) · 1.09 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* functions.php
*
* Add sanity to Theme functions, moving them to thier own files in the /functions folder in both the parent and child
* themes.
*
* @author Jared Deschner
* @since File available since Release 1.0.0
*/
/****************************
* DO NOT EDIT THIS FILE
* Place all custom functions in the functions directory of this theme.
****************************/
if(!function_exists('kalapress_include_dir')) {
function kalapress_include_dir( $path ) {
$dir = new RecursiveDirectoryIterator( $path );
$iterator = new RecursiveIteratorIterator( $dir );
foreach ( $iterator as $file ) {
$fname = $file->getFilename();
if ( preg_match( '%\.php$%', $fname ) ) {
include_once( $file->getPathname() );
}
}
}
}
// Include Parent Theme Functions
kalapress_include_dir(get_template_directory() . '/functions');
// Include Child Theme Functions
kalapress_include_dir(get_stylesheet_directory() . '/functions');
kalapress_include_dir(get_stylesheet_directory() . '/shortcodes');