themes-support.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | function kubio_add_3rd_party_theme_support() { |
| 4 | $stylesheet = get_stylesheet(); |
| 5 | $template = get_template(); |
| 6 | |
| 7 | if ( file_exists( __DIR__ . "/{$template}.php" ) ) { |
| 8 | require_once __DIR__ . "/{$template}.php"; |
| 9 | } |
| 10 | |
| 11 | if ( file_exists( __DIR__ . "/{$stylesheet}.php" ) ) { |
| 12 | require_once __DIR__ . "/{$stylesheet}.php"; |
| 13 | } |
| 14 | |
| 15 | $general = glob( __DIR__ . '/general/*.php' ); |
| 16 | |
| 17 | foreach ( $general as $file ) { |
| 18 | require_once $file; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | add_action( 'init', 'kubio_add_3rd_party_theme_support' ); |
| 23 |