-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathinit.php
executable file
·85 lines (69 loc) · 2.92 KB
/
init.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
<?php
/**
* Title: Elements Initializer
*
* Description: Initializes the elements. Adds all required files.
*
* Please do not edit this file. This file is part of the Cyber Chimps Framework and all modifications
* should be made in a child theme.
*
* @category Cyber Chimps Framework
* @package Framework
* @since 1.0
* @author CyberChimps
* @license http://www.opensource.org/licenses/gpl-license.php GPL v3.0 (or later)
* @link http://www.cyberchimps.com/
*/
// Load style for elements
function cyberchimps_add_elements_style() {
// Set directory uri
$directory_uri = get_template_directory_uri();
wp_enqueue_style( 'elements_style', $directory_uri . '/elements/lib/css/elements.css' );
wp_enqueue_script( 'elements_js', $directory_uri . '/elements/lib/js/elements.min.js' );
}
add_action( 'wp_enqueue_scripts', 'cyberchimps_add_elements_style', 30 );
// Load elements
// Set directory path
$cyberchimps_directory_path = get_template_directory();
require_once get_parent_theme_file_path('/elements/parallax.php' );
require_once get_parent_theme_file_path('/elements/portfolio-lite.php' );
require_once get_parent_theme_file_path('/elements/slider-lite.php' );
require_once get_parent_theme_file_path('/elements/boxes.php' );
require_once get_parent_theme_file_path('/elements/testimonial.php' );
require_once get_parent_theme_file_path('/elements/contact-us.php' );
// main blog drag and drop options
function cyberchimps_selected_elements() {
$options = array(
'boxes_lite' => __( 'Boxes Lite', 'cyberchimps_core' ),
"portfolio_lite" => __( 'Portfolio Lite', 'cyberchimps_core' ),
"blog_post_page" => __( 'Post Page', 'cyberchimps_core' ),
"slider_lite" => __( 'Slider Lite', 'cyberchimps_core' ),
"testimonial" => __( 'Testimonial', 'cyberchimps_core'),
"map_contact" => __( 'Contact Us', 'cyberchimps_core')
);
return $options;
}
add_filter( 'cyberchimps_elements_draganddrop_options', 'cyberchimps_selected_elements' );
function cyberchimps_selected_page_elements() {
$options = array(
'boxes_lite' => __( 'Boxes Lite', 'cyberchimps_core' ),
"portfolio_lite" => __( 'Portfolio Lite', 'cyberchimps_core' ),
"page_section" => __( 'Page', 'cyberchimps_core' ),
"slider_lite" => __( 'Slider Lite', 'cyberchimps_core' ),
"testimonial" => __( 'Testimonial', 'cyberchimps_core'),
"map_contact" => __( 'Contact Us', 'cyberchimps_core')
);
return $options;
}
add_filter( 'cyberchimps_elements_draganddrop_page_options', 'cyberchimps_selected_page_elements' );
// drop breadcrumb fields
function cyberchimps_element_drop_fields( $fields ) {
// drop unwanted fields
foreach( $fields as $key => $value ) {
if( $value['id'] == 'single_post_breadcrumbs' || $value['id'] == 'archive_breadcrumbs' ) {
unset( $fields[$key] );
}
}
return $fields;
}
add_filter( 'cyberchimps_field_filter', 'cyberchimps_element_drop_fields', 2 );