-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
executable file
·52 lines (45 loc) · 1.04 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
/**
*
* @package WordPress
* @subpackage PropxlsTheme
*/
/**
* Timber as a Composer dependency
*/
$composer_autoload = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $composer_autoload ) ) {
require_once $composer_autoload;
$timber = new Timber\Timber();
}
/**
* Check if Timber loaded else show error
*/
if ( ! class_exists( 'Timber' ) ) {
add_action(
'admin_notices',
function() {
echo '<div class="error"><p>Timber not activated. Did you run <pre>composer install</pre>?</p></div>';
}
);
add_filter(
'template_include',
function( $template ) {
return get_stylesheet_directory() . '/static/no-timber.html';
}
);
return;
}
/**
* Sets the directories (inside your theme) to find .twig files
*/
Timber::$dirname = array( 'templates', 'templates/layouts', 'templates/partials' );
/**
* By default, Timber does NOT autoescape values. Want to enable Twig's autoescape?
* No prob! Just set this value to true
*/
Timber::$autoescape = false;
/**
* Bootstrap our theme
*/
require_once('propxls/bootstrap.php');