forked from ahmadawais/WPCustomize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
61 lines (53 loc) · 943 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
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
<?php
/**
* Functions
*
* Theme Functions.
*
* @since 1.0.0
* @package WPC
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Global Constansts for Paths.
*
* @since 1.0.0
*/
if ( ! defined( 'WPC_DIR' ) ) {
define( 'WPC_DIR', get_template_directory() );
}
if ( ! defined( 'WPC_URL' ) ) {
define( 'WPC_URL', get_template_directory_uri() );
}
if ( ! function_exists( 'wpc_theme_styles' ) ) {
// Add Theme Stylesheet.
add_action( 'wp_enqueue_scripts', 'wpc_theme_styles' );
/**
* WPC Theme styles enqueue.
*
* @since 1.0.0
*/
function wpc_theme_styles() {
// Theme Styles.
wp_enqueue_style(
'wpc',
WPC_URL . '/style.css',
array(),
'1.0.0',
'all'
);
}
}
/**
* Customize Init.
*
* WP Customize related stuff.
*
* @since 1.0.0
*/
if ( file_exists( WPC_DIR . '/customizer/wpc-init.php' ) ) {
require_once( WPC_DIR . '/customizer/wpc-init.php' );
}