-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
executable file
·73 lines (59 loc) · 2.38 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
<?php
## Добавление кастомных типов постов
require_once(__DIR__ . '/types/init.php');
## Хелперы
require_once(__DIR__ . '/includes/helpers/include-helper-func.php');
require_once(__DIR__ . '/includes/helpers/include-helper-hooks.php');
require_once(__DIR__ . '/includes/helpers/include-helper-const.php');
require_once(__DIR__ . '/includes/helpers/include-default-hooks.php');
## Hooks
require_once(__DIR__ . '/includes/hooks/include-cf7-hooks.php');
## Modules (Required)
require_once( __DIR__ . '/modules/tmg/init.php');
require_once(__DIR__ . '/modules/acf/init.php');
require_once(__DIR__ . '/modules/acf-menu/init.php');
## Modules
//require_once(__DIR__ . '/modules/breadcrumbs/init.php');
//require_once( __DIR__ . '/modules/load_more/init.php');
//require_once(__DIR__ . '/modules/pagination/init.php');
//require_once(__DIR__ . '/modules/sidebars/add_sidebars.php');
//require_once(__DIR__ . '/modules/compare/init.php');
//require_once(__DIR__ . '/modules/filter/init.php');
add_theme_support('title-tag');
register_nav_menus(array(
'top' => 'Верхнее',
'bottom' => 'Внизу'
// Тут можно добавить еще одну позицию
));
add_theme_support('post-thumbnails');
//set_post_thumbnail_size(250, 150);
//add_image_size('big-thumb', 400, 400, true);
//add_editor_style('assets/styles/c.css');
/**
* Название блоков в админке
*/
add_filter('fleeks_block_title', function ($block_name) {
return match ($block_name) {
'title' => 'Название блока',
default => $block_name,
};
});
## Подключение скриптов
add_action('wp_footer', 'add_scripts');
if (!function_exists('add_scripts')) {
function add_scripts() {
if(is_admin()) return false;
wp_deregister_script('jquery');
wp_enqueue_script('main', FOLDER . '/assets/scripts/main.min.js', false, FLEEKS_VERSION, true);
wp_enqueue_script('loadmore', FOLDER . '/assets/scripts/loadmore.js', ['main'], FLEEKS_VERSION, true);
}
}
## Подключение стилей
add_action('wp_print_styles', 'add_styles');
if (!function_exists('add_styles')) {
function add_styles() {
if(is_admin()) return false;
wp_enqueue_style( 'main', FOLDER . '/assets/styles/main.css', false, FLEEKS_VERSION );
wp_enqueue_style( 'wp', FOLDER . '/assets/styles/wp.css', ['main'], FLEEKS_VERSION );
}
}