-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
115 lines (96 loc) · 3.37 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
<?php
/**
* Created by PhpStorm.
* Project : alpha-elemenda.
* User: hadie MacBook
* Date: 04/06/20
* Time: 03.01
*/
define( 'ALPHA_ELEMENDA_VERSION', '1.0.0' );
if (!function_exists('alpha_elemenda_theme_setup')){
function alpha_elemenda_theme_setup(){
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);
add_theme_support(
'custom-logo',
array(
'height' => 100,
'width' => 350,
'flex-height' => true,
'flex-width' => true,
)
);
register_nav_menus( array(
'primary_menu' => __( 'Primary Menu', 'alpha-elemenda' ),
'footer_menu' => __( 'Footer Menu', 'alpha-elemenda' ),
) );
register_sidebar(array(
'name' => __( 'Main Sidebar ' ) ,
'id' => "main-sidebar",
'description' => '',
'class' => '',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => "</div>",
'before_title' => '<p class="widget-title">',
'after_title' => "</p>",
));
// WooCommerce in general.
add_theme_support( 'woocommerce' );
add_theme_support( 'elementor' );
// Enabling WooCommerce product gallery features (are off by default since WC 3.0.0).
// zoom.
add_theme_support( 'wc-product-gallery-zoom' );
// lightbox.
add_theme_support( 'wc-product-gallery-lightbox' );
// swipe.
add_theme_support( 'wc-product-gallery-slider' );
}
}
add_action( 'after_setup_theme', 'alpha_elemenda_theme_setup' );
function alpha_elemenda_enqueue_styles(){
$min_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$min_suffix = '';
wp_enqueue_style( 'elementor-icons' );
wp_enqueue_style( 'elementor-animations' );
wp_enqueue_style( 'elementor-frontend' );
wp_enqueue_style(
'alpha-elemenda-style',
get_template_directory_uri() . '/dist/css/theme.css',
[],
ALPHA_ELEMENDA_VERSION
);
wp_enqueue_script('alpha-elemenda',get_template_directory_uri() . '/dist/js/app.js',['jquery'],ALPHA_ELEMENDA_VERSION,true);
}
add_action( 'wp_enqueue_scripts', 'alpha_elemenda_enqueue_styles' );
function elemenda_body_opening(){
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
do_action( 'wp_body_open' );
}
}
if (!function_exists('alpha_elemenda_init_loader')){
function alpha_elemenda_init_loader(){
$vendor_file = trailingslashit( get_template_directory() ) . 'vendor/autoload.php';
if ( is_readable( $vendor_file ) ) {
require_once $vendor_file;
}
require_once 'autoloader.php';
$autoloader = new \AlphaElemenda\Autoloader();
$autoloader->add_namespace( 'AlphaElemenda', get_template_directory() . '/includes/' );
$autoloader->register();
}
alpha_elemenda_init_loader();
\AlphaElemenda\Core::instance();
}