-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
219 lines (175 loc) · 6.29 KB
/
Copy pathfunctions.php
File metadata and controls
219 lines (175 loc) · 6.29 KB
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
211
212
213
214
215
216
217
218
219
<?php
/**
* @Packge : Colorlib
* @Version : 1.0
* @Author : Colorlib
* @Author URI : http://colorlib.com/wp/
*
*/
// Block direct access
if( !defined( 'ABSPATH' ) ){
exit( 'Direct script access denied.' );
}
/**
*
* Define constant
*
*/
// Base URI
if( !defined( 'SUPREME_DIR_URI' ) )
define( 'SUPREME_DIR_URI', get_template_directory_uri().'/' );
// assets URI
if( !defined( 'SUPREME_DIR_ASSETS_URI' ) )
define( 'SUPREME_DIR_ASSETS_URI', SUPREME_DIR_URI.'assets/' );
// Css File URI
if( !defined( 'SUPREME_DIR_CSS_URI' ) )
define( 'SUPREME_DIR_CSS_URI', SUPREME_DIR_ASSETS_URI .'css/' );
// Js File URI
if( !defined( 'SUPREME_DIR_JS_URI' ) )
define( 'SUPREME_DIR_JS_URI', SUPREME_DIR_ASSETS_URI .'js/' );
// Icon Images
if( !defined('SUPREME_DIR_ICON_IMG_URI') )
define( 'SUPREME_DIR_ICON_IMG_URI', SUPREME_DIR_ASSETS_URI.'img/icon/' );
//DIR inc
if( !defined( 'SUPREME_DIR_INC' ) )
define( 'SUPREME_DIR_INC', SUPREME_DIR_URI.'inc/' );
//Elementor Widgets Folder Directory
if( !defined( 'SUPREME_DIR_ELEMENTOR' ) )
define( 'SUPREME_DIR_ELEMENTOR', SUPREME_DIR_INC.'elementor-widgets/' );
// Base Directory
if( !defined( 'SUPREME_DIR_PATH' ) )
define( 'SUPREME_DIR_PATH', get_parent_theme_file_path().'/' );
//Inc Folder Directory
if( !defined( 'SUPREME_DIR_PATH_INC' ) )
define( 'SUPREME_DIR_PATH_INC', SUPREME_DIR_PATH.'inc/' );
//Colorlib framework Folder Directory
if( !defined( 'SUPREME_DIR_PATH_LIB' ) )
define( 'SUPREME_DIR_PATH_LIB', SUPREME_DIR_PATH_INC.'libraries/' );
//Classes Folder Directory
if( !defined( 'SUPREME_DIR_PATH_CLASSES' ) )
define( 'SUPREME_DIR_PATH_CLASSES', SUPREME_DIR_PATH_INC.'classes/' );
//Widgets Folder Directory
if( !defined( 'SUPREME_DIR_PATH_WIDGET' ) )
define( 'SUPREME_DIR_PATH_WIDGET', SUPREME_DIR_PATH_INC.'widgets/' );
//Elementor Widgets Folder Directory
if( !defined( 'SUPREME_DIR_PATH_ELEMENTOR_WIDGETS' ) )
define( 'SUPREME_DIR_PATH_ELEMENTOR_WIDGETS', SUPREME_DIR_PATH_INC.'elementor-widgets/' );
/**
* Include File
*
*/
// Breadcrumbs file include
require_once( SUPREME_DIR_PATH_INC . 'supreme-breadcrumbs.php' );
// Sidebar register file include
require_once( SUPREME_DIR_PATH_INC . 'widgets/supreme-widgets-reg.php' );
// Post widget file include
require_once( SUPREME_DIR_PATH_INC . 'widgets/supreme-recent-post-thumb.php' );
// News letter widget file include
require_once( SUPREME_DIR_PATH_INC . 'widgets/supreme-newsletter-widget.php' );
//Social Links
require_once( SUPREME_DIR_PATH_INC . 'widgets/supreme-social-links.php' );
// Instagram Widget
require_once( SUPREME_DIR_PATH_INC . 'widgets/supreme-instagram.php' );
// Nav walker file include
require_once( SUPREME_DIR_PATH_INC . 'wp_bootstrap_navwalker.php' );
// Theme function file include
require_once( SUPREME_DIR_PATH_INC . 'supreme-functions.php' );
// Theme Demo file include
require_once( SUPREME_DIR_PATH_INC . 'demo/demo-import.php' );
// Post Like
require_once( SUPREME_DIR_PATH_INC . 'post-like.php' );
// Theme support function file include
require_once( SUPREME_DIR_PATH_INC . 'support-functions.php' );
// Html helper file include
require_once( SUPREME_DIR_PATH_INC . 'wp-html-helper.php' );
// Pagination file include
require_once( SUPREME_DIR_PATH_INC . 'wp_bootstrap_pagination.php' );
// Elementor Widgets
require_once( SUPREME_DIR_PATH_ELEMENTOR_WIDGETS . 'elementor-widget.php' );
//
require_once( SUPREME_DIR_PATH_CLASSES . 'Class-Enqueue.php' );
require_once( SUPREME_DIR_PATH_CLASSES . 'Class-Config.php' );
// Customizer
require_once( SUPREME_DIR_PATH_INC . 'customizer/customizer.php' );
// Class autoloader
// Class supreme dashboard
// Common css
require_once( SUPREME_DIR_PATH_INC . 'supreme-commoncss.php' );
if( class_exists( 'RW_Meta_Box' ) ){
// Metabox Function
require_once( SUPREME_DIR_PATH_INC . 'supreme-metabox.php' );
}
// Admin Enqueue Script
function supreme_admin_script(){
wp_enqueue_style( 'supreme-admin', get_template_directory_uri().'/assets/css/supreme_admin.css', false, '1.0.0' );
wp_enqueue_script( 'supreme_admin', get_template_directory_uri().'/assets/js/supreme_admin.js', false, '1.0.0' );
}
add_action( 'admin_enqueue_scripts', 'supreme_admin_script' );
// WooCommerce style desable
add_filter( 'woocommerce_enqueue_styles', '__return_false' );
/**
* Instantiate Supreme object
*
* Inside this object:
* Enqueue scripts, Google font, Theme support features, Supreme Dashboard .
*
*/
$Supreme = new Supreme();
/**
* A page by title, without get_page_by_title().
*
* WordPress deprecated get_page_by_title() in 6.2; this keeps the same
* signature and return shape so existing calls behave identically.
*
* @param string $title Page title.
* @param string $output OBJECT, ARRAY_A or ARRAY_N.
* @param string $post_type Post type to search.
* @return WP_Post|array|null
*/
if ( ! function_exists( 'supreme_get_page_by_title' ) ) {
function supreme_get_page_by_title( $title, $output = OBJECT, $post_type = 'page' ) {
$query = new WP_Query(
array(
'post_type' => $post_type,
'title' => $title,
'post_status' => 'all',
'posts_per_page' => 1,
'no_found_rows' => true,
'ignore_sticky_posts' => true,
'update_post_term_cache' => false,
'update_post_meta_cache' => false,
'orderby' => 'post_date ID',
'order' => 'ASC',
)
);
$page = ! empty( $query->posts ) ? $query->posts[0] : null;
if ( ! $page ) {
return null;
}
if ( ARRAY_A === $output ) {
return get_object_vars( $page );
}
if ( ARRAY_N === $output ) {
return array_values( get_object_vars( $page ) );
}
return $page;
}
}
/**
* Editor and markup support this theme predates.
*/
if ( ! function_exists( 'supreme_modern_supports' ) ) {
function supreme_modern_supports() {
add_theme_support( 'responsive-embeds' );
add_theme_support( 'align-wide' );
add_theme_support( 'editor-styles' );
}
add_action( 'after_setup_theme', 'supreme_modern_supports', 20 );
}
/**
* The theme's Customizer controls.
*
* Replaces the Epsilon framework: same fields and stored values,
* built on core's Customizer API.
*/
require_once get_template_directory() . '/inc/customizer/colorlib-customizer/colorlib-customizer.php';