-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
36 lines (30 loc) · 1.16 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
<?php if (!defined('ABSPATH')) exit('direct script access is not allowed');
/**
* This file is part of NovusoPress
*
* @author John Nickell
* @copyright Copyright (c) 2015, Novuso. (http://novuso.com/)
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
use Novuso\WordPress\Theme\NovusoPress\Framework;
$baseDir = get_template_directory();
$childDir = get_stylesheet_directory();
// Composer install is required at the project or theme level
if (!class_exists('Novuso\\WordPress\\Theme\\NovusoPress\\Framework')) {
if (file_exists($baseDir.'/vendor/autoload.php')) {
require $baseDir.'/vendor/autoload.php';
} elseif (file_exists($childDir.'/vendor/autoload.php')) {
require $childDir.'/vendor/autoload.php';
} else {
throw new RuntimeException('Composer install required');
}
}
// include helper functions
require $baseDir.'/core/comments.php';
require $baseDir.'/core/searchform.php';
require $baseDir.'/core/formatting.php';
Framework::instance()->init();
Framework::instance()->getViewMeta()->addElement([
'name' => 'viewport',
'content' => 'width=device-width, initial-scale=1'
]);