-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
104 lines (82 loc) · 2.29 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
<?php
/**
* Template functions and definitions
*
* @package WpKitElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'WPKIT_ELEMENTOR_VERSION', '1.0.6' );
function wp_kit_elementor_setup() {
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// Let WordPress manage the document title for us
add_theme_support( 'title-tag' );
// Custom Logo
add_theme_support( 'custom-logo', [
'height' => 100,
'width' => 350,
'flex-height' => true,
'flex-width' => true,
] );
// Set the default content width.
$GLOBALS['content_width'] = 960;
// This theme uses wp_nav_menu() in one location
register_nav_menus( array(
'primary' => __( 'Primary', 'wp-kit-elementor' ),
'footer' => __( 'Footer', 'wp-kit-elementor' ),
) );
// Switch default core markup for search form, comment form, and comments to output valid HTML5
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'script',
'style',
) );
/*
* Editor Style.
*/
add_editor_style( 'style-editor.css' );
// Gutenberg Embeds
add_theme_support( 'responsive-embeds' );
add_theme_support( "post-thumbnails" );
// Gutenberg Widget Images
add_theme_support( 'align-wide' );
// Setup WooCommerce
if ( class_exists( 'WooCommerce' ) ) {
// WooCommerce in general.
add_theme_support( 'woocommerce' );
// zoom.
add_theme_support( 'wc-product-gallery-zoom' );
// lightbox.
add_theme_support( 'wc-product-gallery-lightbox' );
// slider.
add_theme_support( 'wc-product-gallery-slider' );
}
}
add_action( 'after_setup_theme', 'wp_kit_elementor_setup' );
function wp_kit_elementor_scripts() {
$min_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
// Theme Stylesheet
wp_enqueue_style(
'wp-kit-elementor-frontend',
get_stylesheet_uri(),
array(),
WPKIT_ELEMENTOR_VERSION
);
// Comment reply link
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_style(
'wp-kit-elementor-theme',
get_stylesheet_directory_uri() . '/theme' . $min_suffix . '.css',
array(),
WPKIT_ELEMENTOR_VERSION
);
}
add_action( 'wp_enqueue_scripts', 'wp_kit_elementor_scripts' );