-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
executable file
·170 lines (120 loc) · 4.25 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
<?php
define( 'PERGO_VERSION', '1.3.5' );
define( 'PERGO_URI', get_template_directory_uri() );
define( 'PERGO_DIR', get_template_directory() );
// Set content width value based on the theme's design
if ( ! isset( $content_width ) )
$content_width = 1170;
if ( ! function_exists('pergo_theme_features') ) {
// Register Theme Features
function pergo_theme_features() {
// Add theme support for Automatic Feed Links
add_theme_support( 'automatic-feed-links' );
// Add theme support for Post Formats
add_theme_support( 'post-formats', array( 'video' ) );
// Add theme support for Featured Images
add_theme_support( 'post-thumbnails' );
add_image_size( 'pergo-800x400-crop', 800, 400, true );
add_image_size( 'pergo-700x700-crop', 700, 700, true );
add_image_size( 'pergo-600x600-crop', 600, 600, true );
add_image_size( 'pergo-400x400-crop', 400, 400, true );
add_image_size( 'pergo-400x500-crop', 400, 500, true );
add_image_size( 'pergo-400x--nocrop', 400, '', false );
add_image_size( 'pergo-150x150-crop', 150, 150, true );
// add theme support for woocommerce
add_theme_support( 'woocommerce' );
// Set custom thumbnail dimensions
set_post_thumbnail_size( 830, 540, true );
// Add theme support for Custom Background
$background_args = array(
'default-color' => '#fff',
'default-image' => '',
'default-repeat' => '',
'default-position-x' => ''
);
//add_theme_support( 'custom-background', $background_args );
// Add theme support for HTML5 Semantic Markup
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
// Add theme support for document Title tag
add_theme_support( 'title-tag' );
// Add theme support for custom CSS in the TinyMCE visual editor
add_editor_style( 'css/editor-style.css', pergo_fonts_url(), 'css/flaticon.css' );
// Add theme support for Translation
load_theme_textdomain( 'pergo', get_template_directory() . '/languages' );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add support for Block Styles.
add_theme_support( 'wp-block-styles' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// Add support for editor styles.
add_theme_support( 'editor-styles' );
// Add support for responsive embedded content.
add_theme_support( 'responsive-embeds' );
}
add_action( 'after_setup_theme', 'pergo_theme_features' );
}
if ( !function_exists( 'pergo_navigation_menus' ) ) {
// Register Navigation Menus
function pergo_navigation_menus() {
$locations = array(
'primary' => __( 'Header Menu', 'pergo' )
);
register_nav_menus( $locations );
}
add_action( 'init', 'pergo_navigation_menus' );
} //!function_exists( 'pergo_navigation_menus' )
// Required: include google fonts.
require( PERGO_DIR . '/admin/google-web-fonts.php' );
function pergo_default_color(){
return 'rose';
}
/**
* Filters the Layouts ID
*/
function pergo_filter_demo_layouts_id() {
return 'pergo';
}
add_filter( 'ot_layouts_id', 'pergo_filter_demo_layouts_id' );
/**
* Theme Mode
*/
add_filter( 'ot_theme_mode', '__return_true' );
/**
* Child Theme Mode
*/
add_filter( 'ot_child_theme_mode', '__return_false' );
/**
* Show Settings Pages
*/
add_filter( 'ot_show_pages', '__return_false' );
/**
* Show Theme Options UI Builder
*/
add_filter( 'ot_show_options_ui', '__return_false' );
/**
* Show Settings Import
*/
add_filter( 'ot_show_settings_import', '__return_false' );
/**
* Show Settings Export
*/
add_filter( 'ot_show_settings_export', '__return_false' );
/**
* Show New Layout
*/
add_filter( 'ot_show_new_layout', '__return_true' );
/**
* Show posts format
*/
add_filter( 'ot_post_formats', '__return_true' );
// Required: include OptionTree.
require( PERGO_DIR . '/option-tree/ot-loader.php' );
// Theme Options
require( PERGO_DIR . '/admin/theme-options.php' );
//admin functions
include PERGO_DIR. '/admin/functions.php';
//frontent functions
include PERGO_DIR. '/includes/functions.php';
//required plugins
require( PERGO_DIR . '/tgmpa/pergo-plugins.php' );