forked from brittonwalker/tktk-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
35 lines (31 loc) · 961 Bytes
/
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
<?php
/**
* The tktk theme functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package tktk
*/
/**
* This ensures that Timber is loaded and available as a PHP class.
* If not, it gives an error message to help direct developers on where to activate
*/
if ( ! class_exists( 'Timber' ) ) {
add_action(
'admin_notices',
function() {
echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . esc_url( admin_url( 'plugins.php#timber' ) ) . '">' . esc_url( admin_url( 'plugins.php' ) ) . '</a></p></div>';
}
);
add_filter(
'template_include',
function( $template ) {
return get_stylesheet_directory() . '/static/no-timber.html';
}
);
return;
};
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/classes/Setup.php';
require_once __DIR__ . '/classes/Enqueue.php';
require_once __DIR__ . '/classes/TimberContext.php';