diff --git a/.gitignore b/.gitignore index 6833953..deb1aa2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,15 @@ -# ---> WordPress -# Wordpress - ignore core, configuration, examples, uploads and logs. -# https://github.com/github/gitignore/blob/main/WordPress.gitignore +# htaccess +.htaccess + +# GP | SEO +sitemap*.xml +!robots.txt +yandex_*.html +google_*.html +yandex_turbo.xml +turbo_yandex.xml # Core -# -# Note: if you want to stage/commit WP core files -# you can delete this whole section/until Configuration. /wp-admin/ /wp-content/index.php /wp-content/languages @@ -20,6 +24,11 @@ # Configuration wp-config.php +wp-config-sample.php + +#plugins +wp-content/plugins/* +/wp-content/plugins/* # Example themes /wp-content/themes/twenty*/ @@ -29,26 +38,85 @@ wp-config.php # Uploads /wp-content/uploads/ +!/wp-content/uploads/elementor +/wp-content/uploads-webpc/ # Log files *.log -# htaccess -/.htaccess -/*/.htaccess -# vendor files in themes -/wp-content/themes/*/vendor -# All plugins -# -# Note: If you wish to whitelist plugins, - -/wp-content/plugins -/wp-content/backups-dup-lite -/wp-content/ai1wm-backups -/wp-content/uploads-webpc - -# All themes -# -# Note: If you wish to whitelist themes, -# uncomment the next line -#/wp-content/themes +# GP | Files ext +*.sql +*.tgz +*.tar.gz +*.tar +*.rar +*.zip +*.mp3 +*.mp4 +*.webm +*.mov +*.MOV +*.wav +*.flv +*.db +*.psd +*.pdf +*.doc +*.docx +*.txt +*.text +*.log +*.config +*.xml +*.tbk +*.csv +*.json +*.BAK + +# GP | Dirs & files +bower_components/ +node_modules/ +nbproject/ +cache/ +.cache/ +phpMyAdmin-* +timthumb_cache/ +webstat/ +.idea/ +.tmb/ +.csscomb.json +sftp-config.json +bower.json +.bowerrc +backup_rsync/ +.bash_history +.idea/ +.fleet/ +.DS_Store +.config/ +.bash* +.vim* +test/ +test*.php +gp-test*/ +gp-test*.php +*/ewww/ +.*_lock +db.php +*/w3tc* +*/wpvivid* +*/mu-plugins/ +vendor/ +wp-content/webp* + +# GP | Duplicator +dup-installer/ +*archive.daf +installer* +wp-content/backups-dup-lite/ + +# GP | Query Monitor +wp-content/db.php + +# Node-js скрипт для индексации 100 url в сутки +.google-indexing/ \ No newline at end of file diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php index 6294084..f6405ef 100644 --- a/wp-content/themes/cosmopet/functions.php +++ b/wp-content/themes/cosmopet/functions.php @@ -24,11 +24,11 @@ add_filter( 'timber/integrations', function ( array $integrations ): array { return $integrations; } ); -function theme_enqueue_scripts() { - // Swiper - wp_enqueue_script( 'gp-front-page-materialize', get_template_directory_uri() . '/modules/layout/assets/js/materialize.min.js', array(), null, true ); -} -add_action('wp_enqueue_scripts', 'theme_enqueue_scripts'); +// function theme_enqueue_scripts() { +// // Swiper +// wp_enqueue_script( 'gp-front-page-materialize', get_template_directory_uri() . '/modules/layout/assets/js/materialize.min.js', array(), null, true ); +// } +// add_action('wp_enqueue_scripts', 'theme_enqueue_scripts'); add_action('timber/init', function() { diff --git a/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css b/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css index 4ab6a74..a0fb9f7 100644 --- a/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css +++ b/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css @@ -1270,14 +1270,11 @@ textarea{ } .toggle::after{ content: ''; - position: absolute; top: 24px; right: 0; - width: 24px; aspect-ratio: 1; - background-image: url(../img/svg/main/black-x.svg); transform: rotate(45deg); transition: transform .2s; diff --git a/wp-content/themes/cosmopet/modules/layout/assets/img/svg/main/black-x.svg b/wp-content/themes/cosmopet/modules/layout/assets/img/svg/main/black-x.svg new file mode 100644 index 0000000..cb3041d --- /dev/null +++ b/wp-content/themes/cosmopet/modules/layout/assets/img/svg/main/black-x.svg @@ -0,0 +1,11 @@ + diff --git a/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js b/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js index 60c24ee..c10052e 100644 --- a/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js +++ b/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js @@ -450,26 +450,6 @@ if (document.querySelector('.header').classList.contains('white')) { // }); // }); -var slider = carousel_init(); - -function carousel_init() { - var carousel = document.querySelectorAll('.carousel'); - var options = { - numVisible: window.innerWidth > 421 ? 5 : 3, - indicators: false // Removed dots - }; - var instances = M.Carousel.init(carousel, options); - document.querySelectorAll('.about_slider_nav').forEach(btn => { - btn.addEventListener('click', function (e) { - if (e.target.closest('button').classList.contains('next')) { - instances[0].next(); - } else { - instances[0].prev(); - } - }); - }); - return instances; -} document.addEventListener('DOMContentLoaded', function () { const petsSlider = new Swiper(".discount_cosmodog__slider", { diff --git a/wp-content/themes/cosmopet/static/front-page/js/main.js b/wp-content/themes/cosmopet/static/front-page/js/main.js index 4a503b4..de71efc 100644 --- a/wp-content/themes/cosmopet/static/front-page/js/main.js +++ b/wp-content/themes/cosmopet/static/front-page/js/main.js @@ -596,3 +596,25 @@ document.addEventListener('DOMContentLoaded', function() { } // Close popup when clicking outside }); + + +var slider = carousel_init(); + +function carousel_init() { + var carousel = document.querySelectorAll('.carousel'); + var options = { + numVisible: window.innerWidth > 421 ? 5 : 3, + indicators: false // Removed dots + }; + var instances = M.Carousel.init(carousel, options); + document.querySelectorAll('.about_slider_nav').forEach(btn => { + btn.addEventListener('click', function (e) { + if (e.target.closest('button').classList.contains('next')) { + instances[0].next(); + } else { + instances[0].prev(); + } + }); + }); + return instances; +} \ No newline at end of file diff --git a/wp-content/themes/cosmopet/modules/layout/assets/js/materialize.min.js b/wp-content/themes/cosmopet/static/front-page/js/materialize.min.js similarity index 100% rename from wp-content/themes/cosmopet/modules/layout/assets/js/materialize.min.js rename to wp-content/themes/cosmopet/static/front-page/js/materialize.min.js diff --git a/wp-content/themes/cosmopet/templates/front-page/template-front-page.php b/wp-content/themes/cosmopet/templates/front-page/template-front-page.php index dcf4618..2d76143 100644 --- a/wp-content/themes/cosmopet/templates/front-page/template-front-page.php +++ b/wp-content/themes/cosmopet/templates/front-page/template-front-page.php @@ -8,14 +8,15 @@ false, 'version' => '1.0.0']); -}); - +function theme_enqueue_scripts() { + // Swiper + wp_enqueue_style('gp-front-page-carousel', get_template_directory_uri() . '/static/front-page/css/carousel.css'); + wp_enqueue_style('gp-front-page-materialize-css', get_template_directory_uri() . '/static/front-page/css/materialize.min.css'); + wp_enqueue_style('gp-front-page-style', get_template_directory_uri() . '/static/front-page/css/style.css'); + wp_enqueue_script( 'gp-front-page-materialize', get_template_directory_uri() . '/static/front-page/js/materialize.min.js', array(), null, true ); + wp_enqueue_script( 'gp-front-page-main', get_template_directory_uri() . '/static/front-page/js/main.js', array(), null, true ); +} +add_action('wp_enqueue_scripts', 'theme_enqueue_scripts'); // Создаем функцию для получения постов function get_blog_posts_data() { diff --git a/wp-content/themes/cosmopet/templates/pet-card.twig b/wp-content/themes/cosmopet/templates/pet-card.twig index f1d642c..b0c76fc 100644 --- a/wp-content/themes/cosmopet/templates/pet-card.twig +++ b/wp-content/themes/cosmopet/templates/pet-card.twig @@ -10,37 +10,37 @@
{{ pll_e('Breed') }}:
+{{ fn('pll_e', 'Breed') }}:
{{ function('get_field', 'breed', pet_id) }}
{{ pll_e('Weight') }}:
+{{ fn('pll_e','Weight') }}:
{% set weight_key = function('get_field', 'weight', pet_id) %} - {% if weight_key == 'below_1_5' %}{{ pll_e('from 0,5 kg to 1,5 kg') }} - {% elseif weight_key == '1_5-3' %}{{ pll_e('from 1.5 to 3 kg') }} - {% elseif weight_key == '3-5' %}{{ pll_e('from 3 to 5 kg') }} - {% elseif weight_key == '5-8' %}{{ pll_e('from 5 to 8 kg') }} - {% elseif weight_key == '8-11' %}{{ pll_e('from 8 to 11 kg') }} - {% elseif weight_key == '11-15' %}{{ pll_e('from 11 to 15 kg') }} - {% elseif weight_key == '15-20' %}{{ pll_e('from 15 to 20 kg') }} - {% elseif weight_key == '20-25' %}{{ pll_e('from 20 to 25 kg') }} - {% elseif weight_key == '25-35' %}{{ pll_e('from 25 to 35 kg') }} - {% elseif weight_key == 'more_35' %}{{ pll_e('More than 35 kg') }} + {% if weight_key == 'below_1_5' %}{{ fn('pll_e', 'from 0,5 kg to 1,5 kg') }} + {% elseif weight_key == '1_5-3' %}{{ fn('pll_e', 'from 1.5 to 3 kg') }} + {% elseif weight_key == '3-5' %}{{ fn('pll_e', 'from 3 to 5 kg') }} + {% elseif weight_key == '5-8' %}{{ fn('pll_e', 'from 5 to 8 kg') }} + {% elseif weight_key == '8-11' %}{{ fn('pll_e', 'from 8 to 11 kg') }} + {% elseif weight_key == '11-15' %}{{ fn('pll_e', 'from 11 to 15 kg') }} + {% elseif weight_key == '15-20' %}{{ fn('pll_e', 'from 15 to 20 kg') }} + {% elseif weight_key == '20-25' %}{{ fn('pll_e', 'from 20 to 25 kg') }} + {% elseif weight_key == '25-35' %}{{ fn('pll_e', 'from 25 to 35 kg') }} + {% elseif weight_key == 'more_35' %}{{ fn('pll_e', 'More than 35 kg') }} {% endif %}
{{ pll_e('Age') }}:
+{{ fn('pll_e', 'Age') }}:
{% set age_key = function('get_field', 'old', pet_id) %} - {% if age_key == 'normal' %}{{ pll_e('Adult (from 1 year to 7 years)') }} - {% elseif age_key == 'old' %}{{ pll_e('Elderly (from 7 to 12 years)') }} - {% elseif age_key == 'very_old' %}{{ pll_e('Aging (12 years and older)') }} - {% elseif age_key == 'baby' %}{{ pll_e('Baby (from 0 to 1 year)') }} + {% if age_key == 'normal' %}{{ fn('pll_e', 'Adult (from 1 year to 7 years)') }} + {% elseif age_key == 'old' %}{{ fn('pll_e', 'Elderly (from 7 to 12 years)') }} + {% elseif age_key == 'very_old' %}{{ fn('pll_e', 'Aging (12 years and older)') }} + {% elseif age_key == 'baby' %}{{ fn('pll_e', 'Baby (from 0 to 1 year)') }} {% endif %}
{{ pll_e('Birthday') }}:
+{{ fn('pll_e', 'Birthday') }}:
{{ function('get_field', 'day', pet_id) }}.{{ zero }}{{ month }}.{{ function('get_field', 'year', pet_id) }}
@@ -56,25 +56,25 @@ {% endif %}{{ pll_e('Activity') }}:
+{{ fn('pll_e', 'Activity') }}:
{% set activity_key = function('get_field', 'activity', pet_id) %} - {% if activity_key == 'low' %}{{ pll_e('Low') }} - {% elseif activity_key == 'moderate' %}{{ pll_e('Moderate') }} - {% elseif activity_key == 'high' %}{{ pll_e('High') }} + {% if activity_key == 'low' %}{{ fn('pll_e', 'Low') }} + {% elseif activity_key == 'moderate' %}{{ fn('pll_e', 'Moderate') }} + {% elseif activity_key == 'high' %}{{ fn('pll_e', 'High') }} {% endif %}
{{ pll_e('Sterilized') }}
+{{ fn('pll_e', 'Sterilized') }}
{{ age.title }} {{ age.desc }}
-{{ fn('pll_e', 'Малыш') }} {{ fn('pll_e', '(от 0 до 1 года)') }}
+{{ fn('pll_e', 'Взрослый') }} {{ fn('pll_e', '(от 1 года до 7 лет)') }}
+{{ fn('pll_e', 'Пожилой') }} {{ fn('pll_e', '(от 7 до 12 лет)') }}
+{{ fn('pll_e', 'Стареющий') }} {{ fn('pll_e', '(от 12 лет и старше)') }}
+{{ month.text }}
- -