forked from mamurjordev/craftnce-agency-wordpress-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
210 lines (191 loc) · 10 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?php
get_template_part('inc/craftnce-functions');
get_template_part('lib/customizer/craftnce-customizer');
get_template_part('lib/craftnce-nav-walker');
if(!function_exists('craftnce_theme_setup')) {
function craftnce_theme_setup() {
// Load Theme TextDomain
load_theme_textdomain('craftnce');
// Theme Supports
add_theme_support('title-tag');
add_theme_support('description');
add_theme_support('widgets');
add_theme_support('post-thumbnails');
add_theme_support('custom-header');
add_theme_support('custom-logo');
add_theme_support('custom-background');
add_theme_support( 'automatic-feed-links' );
add_theme_support(
'html5',
array(
'comment-form',
'comment-list',
'gallery',
'caption',
'style',
'script',
'navigation-widgets',
)
);
register_nav_menus(array(
'primary-menu' => __('Primary Menu', 'craftnce'),
));
}
add_action('after_setup_theme', 'craftnce_theme_setup');
}
function craftnce_assets_enqueue() {
// Stylesheets Enqueue
wp_enqueue_style('craftnce-google-fonts', '//fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
wp_enqueue_style('craftnce-bootstrap-css', get_template_directory_uri().'/assets/css/bootstrap.css');
wp_enqueue_style('craftnce-slick-css', get_template_directory_uri().'/assets/css/slick.css');
wp_enqueue_style('craftnce-slick-theme-css', get_template_directory_uri().'/assets/css/slick-theme.css');
wp_enqueue_style('craftnce-fontawesome-main', get_template_directory_uri().'/assets/css/fontawesome.css');
wp_enqueue_style('craftnce-fontawesome-all', get_template_directory_uri().'/assets/css/all.css');
wp_enqueue_style('craftnce-main-style', get_template_directory_uri().'/assets/css/style.css');
wp_enqueue_style('craftnce-responsive-style', get_template_directory_uri().'/assets/css/responsive.css');
wp_enqueue_style('craftnce-theme-default-css', get_stylesheet_uri());
// JS Enqueue
wp_enqueue_script( 'comment-reply' );
wp_enqueue_script('craftnce-popper-js', get_template_directory_uri().'/assets/js/popper.js', null, time(), true);
wp_enqueue_script('craftnce-bootstrap-js', get_template_directory_uri().'/assets/js/bootstrap.js', null, time(), true);
wp_enqueue_script('craftnce-slick-slider-js', get_template_directory_uri().'/assets/js/slick.js', null, time(), true);
wp_enqueue_script('craftnce-main-js', get_template_directory_uri().'/assets/js/main.js', array('jquery'), time(), true);
}
add_action('wp_enqueue_scripts', 'craftnce_assets_enqueue');
// Sidebars and Widgets
function craftnce_sidebar_widget_area() {
// Page Sidebar
register_sidebar( array(
'name' => __( 'Page Sidebar', 'craftnce' ),
'id' => 'page_sidebar',
'description' => __( 'Default page sidebar what will display in page if not select full width layout', 'craftnce' ),
'before_widget' => '<div id="%1$s" class="sidebar-area rounded-3 p-4">',
'after_widget' => '</div>',
'before_title' => '<h4 class="mb-1">',
'after_title' => '</h4>',
));
/**
* ================================================
* ======= Upper Panel Widget Area ================
* ================================================
*/
register_sidebar( array(
'name' => __( '1st Upper Footer Widget Area', 'craftnce' ),
'id' => 'first_upper_footer_widget_area',
'description' => __( 'This widget area is for upper layout first panel', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
register_sidebar( array(
'name' => __( '2nd Upper Footer Widget Area', 'craftnce' ),
'id' => 'second_upper_footer_widget_area',
'description' => __( 'This widget area is for upper layout second panel', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
register_sidebar( array(
'name' => __( '3rd Upper Footer Widget Area', 'craftnce' ),
'id' => 'third_upper_footer_widget_area',
'description' => __( 'This widget area is for upper layout third panel', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
register_sidebar( array(
'name' => __( '4th Upper Footer Widget Area', 'craftnce' ),
'id' => 'fourth_upper_footer_widget_area',
'description' => __( 'This widget area is for upper layout fourth panel', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
register_sidebar( array(
'name' => __( '5th Upper Footer Widget Area', 'craftnce' ),
'id' => 'fifth_upper_footer_widget_area',
'description' => __( 'This widget area is for upper layout fifth panel', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
register_sidebar( array(
'name' => __( '6th Upper Footer Widget Area', 'craftnce' ),
'id' => 'sixth_upper_footer_widget_area',
'description' => __( 'This widget area is for upper layout sixth panel', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
/**
* ================================================
* ======= Bottom Panel Widget Area ================
* ================================================
*/
register_sidebar( array(
'name' => __( '1st Bottom Footer Widget Area', 'craftnce' ),
'id' => 'first_bottom_footer_widget_area',
'description' => __( 'This widget area is for upper layout first panel', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
register_sidebar( array(
'name' => __( '2nd Upper Footer Widget Area', 'craftnce' ),
'id' => 'second_bottom_footer_widget_area',
'description' => __( 'This widget area is for upper layout first panel', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
register_sidebar( array(
'name' => __( '3rd Upper Footer Widget Area', 'craftnce' ),
'id' => 'third_bottom_footer_widget_area',
'description' => __( 'This widget area is for upper layout first panel', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
/**
* ================================================
* ======= Bottom Panel Widget Area ================
* ================================================
*/
register_sidebar( array(
'name' => __( 'Footer Bottom First Widget Area', 'craftnce' ),
'id' => 'footer_bottom_first_widget_area',
'description' => __( 'This widget area is for bottom first area', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
register_sidebar( array(
'name' => __( 'Footer Bottom Second Widget Area', 'craftnce' ),
'id' => 'footer_bottom_second_widget_area',
'description' => __( 'This widget area is for bottom second area', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
register_sidebar( array(
'name' => __( 'Footer Bottom Third Widget Area', 'craftnce' ),
'id' => 'footer_bottom_third_widget_area',
'description' => __( 'This widget area is for bottom third area', 'craftnce' ),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="text-light">',
'after_title' => '</h6>',
));
}
add_action('widgets_init', 'craftnce_sidebar_widget_area');