回答編集履歴
1
コード修正
answer
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
|
5
5
|
```php
|
6
6
|
|
7
|
-
function get_template_parts_in_dir($
|
7
|
+
function get_template_parts_in_dir($path='functions') {
|
8
|
-
$dir = scandir(get_stylesheet_directory().'/'.$
|
8
|
+
$dir = scandir(get_stylesheet_directory().'/'.$path);
|
9
9
|
|
10
10
|
foreach( $dir as $fileName ) {
|
11
11
|
if( substr($fileName,-4)==='.php' ) {
|
12
12
|
$fileName = basename($fileName, ".php");
|
13
|
-
get_template_part($
|
13
|
+
get_template_part($path.'/'. $fileName);
|
14
14
|
}
|
15
15
|
}
|
16
16
|
}
|