-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
75 lines (55 loc) · 1.62 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* **************************************************
*
* File Name: functions.php
* Description: This file contains the whole logic of this theme, sets some constants and includes various important files
*
* @since 1.0.0
*
* **************************************************
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
*
* Define EventPresso Launch theme constants
*
* @since 1.0.0
* @return void
*
*/
add_action( 'after_setup_theme', 'demokit_constants' );
function demokit_constants() {
if ( ! defined( 'THEME_NAME' ) )
define( 'THEME_NAME', 'DemoKit' );
if ( ! defined( 'THEME_SLUG' ) )
define( 'THEME_SLUG', 'demokit' );
if ( ! defined( 'THEME_VERSION' ) )
define( 'THEME_VERSION', '1.1.0' );
if ( ! defined( 'THEME_TEMPLATE_DIR' ) )
define( 'THEME_TEMPLATE_DIR', get_template_directory() );
if ( ! defined( 'THEME_TEMPLATE_URL' ) )
define( 'THEME_TEMPLATE_URL', get_template_directory_uri() );
if ( ! defined( 'THEME_STYLESHEET_DIR' ) )
define( 'THEME_STYLESHEET_DIR', get_stylesheet_directory() );
if ( ! defined( 'THEME_STYLESHEET_URL' ) )
define( 'THEME_STYLESHEET_URL', get_stylesheet_directory_uri() );
}
function demokit_get_json() {
// read config file and create config object
$config = @file_get_contents( get_template_directory_uri() . '/content/items.json' );
$configObject = $config ? json_decode( $config ) : null;
return $configObject;
}
function demokit_get_items() {
return demokit_get_json()->items;
}
/**
* Load all the additional files and features
*
* @since 1.0.0
*/
require 'includes/class-demokit.php';