-
Notifications
You must be signed in to change notification settings - Fork 11
/
functions.php
52 lines (43 loc) · 1.28 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* WP Theme constants and setup functions
*
* @package Skela
*/
/**
* Require the autoloader.
*/
require_once 'vendor/autoload.php';
use Skela\Managers\ThemeManager;
define( 'SKELA_THEME_URL', get_stylesheet_directory_uri() );
define( 'SKELA_THEME_PATH', dirname( __FILE__ ) . '/' );
define( 'SKELA_DOMAIN', get_site_url() );
define( 'SKELA_SITE_NAME', get_bloginfo( 'name' ) );
define( 'SKELA_THEME_VERSION', wp_get_theme()->get( 'Version' ) );
/**
* Use Dotenv to set required environment variables and load .env file when present.
*/
Dotenv\Dotenv::create( __DIR__ )->safeLoad();
/**
* Set up our global environment constant and load its config first
* Default: production
*/
define( 'WP_ENV', getenv( 'WP_ENV' ) ? getenv( 'WP_ENV' ) : 'production' );
$timber = new Timber\Timber();
Timber::$dirname = array( 'templates' );
add_action(
'after_setup_theme',
function () {
$managers = array(
/* new \Skela\Managers\TaxonomiesManager(), */
new \Skela\Managers\WordPressManager(),
new \Skela\Managers\GutenbergManager(),
new \Skela\Managers\CustomPostsManager(),
);
if ( function_exists( 'acf_add_local_field_group' ) ) {
$managers[] = new \Skela\Managers\ACFManager();
}
$theme_manager = new ThemeManager( $managers );
$theme_manager->run();
}
);