You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
3.0 KiB
75 lines
3.0 KiB
<?php
|
|
require_once __DIR__ . '/vendor/autoload.php'; // для работы Composer пакетов (библиотек)
|
|
|
|
// Initialize Timber.
|
|
Timber\Timber::init();
|
|
|
|
|
|
// require once вместо include использовать!
|
|
require_once __DIR__ . '/temp-functions/cart-logic.php';
|
|
require_once __DIR__ . '/temp-functions/timber-logic.php';
|
|
require_once __DIR__ . '/temp-functions/woocommerce-logic.php';
|
|
require_once __DIR__ . '/temp-functions/modules-logic.php';
|
|
require_once __DIR__ . '/temp-functions/ajax-logic.php';
|
|
require_once __DIR__ . '/temp-functions/shortcodes-logic.php';
|
|
require_once __DIR__ . '/temp-functions/blog-logic.php';
|
|
require_once __DIR__ . '/temp-functions/filters-logic.php';
|
|
|
|
// include_module('forms');
|
|
// include_module('shop');
|
|
// include_module('profile');
|
|
// include_module('footer');
|
|
// include_module('author');
|
|
// include_module('layout');
|
|
|
|
|
|
|
|
function theme_enqueue_scripts() {
|
|
$base_dir = get_template_directory_uri() . '/static/js/';
|
|
// Библиотеки
|
|
wp_enqueue_script('materialize', $base_dir . 'libs/materialize.min.js', array(), null, true);
|
|
wp_enqueue_script('swiper-bundle', $base_dir . 'libs/swiper-bundle.min.js', array(), null, true);
|
|
|
|
// Скрипты из js-single-product
|
|
wp_enqueue_script('gp-form', $base_dir . 'js-single-product/gp-form.js', array(), null, true);
|
|
wp_enqueue_script('gp-main', $base_dir . 'js-single-product/gp-main.js', array(), null, true);
|
|
wp_enqueue_script('gp-product', $base_dir . 'js-single-product/gp-product.js', array(), null, true);
|
|
wp_enqueue_script('tabs', $base_dir . 'js-single-product/tabs.js', array(), null, true);
|
|
wp_enqueue_script('toggle', $base_dir . 'js-single-product/toggle.js', array(), null, true);
|
|
|
|
// Основные скрипты
|
|
$scripts = array(
|
|
'about-page', 'author-posts-ajax', 'blog', 'cart', 'checkout', 'comments',
|
|
'footer', 'forms', 'front-page', 'header', 'layout-core', 'layout-form',
|
|
'layout-main', 'layout-product', 'modal', 'popups', 'production-page',
|
|
'profile', 'script', 'tags-in-wpf_filter', 'wtb-page'
|
|
);
|
|
|
|
foreach ($scripts as $script) {
|
|
wp_enqueue_script($script, $base_dir . $script . '.js', array(), null, true);
|
|
}
|
|
}
|
|
add_action('wp_enqueue_scripts', 'theme_enqueue_scripts');
|
|
|
|
|
|
function theme_enqueue_styles() {
|
|
$base_dir = get_template_directory_uri() . '/static/css/';
|
|
$libs_dir = $base_dir . 'libs/';
|
|
|
|
// CSS из папки libs
|
|
wp_enqueue_style('materialize', $libs_dir . 'materialize.min.css');
|
|
wp_enqueue_style('swiper-bundle', $libs_dir . 'swiper-bundle.css');
|
|
|
|
// Основные CSS-файлы
|
|
$styles = array(
|
|
'about-page', 'author-style', 'blog-style', 'checkout', 'footer',
|
|
'forms', 'front-page', 'gp-layout-core', 'gp-layout-full',
|
|
'gp-normalize', 'header', 'production-page', 'profile', 'shop',
|
|
'single-product', 'style', 'wtb-page'
|
|
);
|
|
|
|
foreach ($styles as $style) {
|
|
wp_enqueue_style($style, $base_dir . $style . '.css');
|
|
}
|
|
}
|
|
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');
|
|
|