pull/1/head
GP_DV 4 months ago
parent df57279296
commit fa60944439
  1. 0
      .user.ini
  2. 9
      wp-content/ai1wm-backups/.htaccess
  3. 1
      wp-content/ai1wm-backups/index.html
  4. 1
      wp-content/ai1wm-backups/index.php
  5. 3
      wp-content/ai1wm-backups/robots.txt
  6. 13
      wp-content/ai1wm-backups/web.config
  7. 0
      wp-content/themes/cosmopet/modules/header/module-ajax-controller.php
  8. 65
      wp-content/themes/cosmopet/modules/header/module-controller.php
  9. 154
      wp-content/themes/cosmopet/modules/header/module.template_ENG.twig
  10. 150
      wp-content/themes/cosmopet/modules/header/module.template_RU.twig
  11. 26
      wp-content/themes/cosmopet/templates/header.twig

@ -1,9 +0,0 @@
<IfModule mod_mime.c>
AddType application/octet-stream .wpress
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>

@ -1 +0,0 @@
Kangaroos cannot jump here

@ -1 +0,0 @@
Kangaroos cannot jump here

@ -1,3 +0,0 @@
User-agent: *
Disallow: /ai1wm-backups/
Disallow: /wp-content/ai1wm-backups/

@ -1,13 +0,0 @@
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".wpress" mimeType="application/octet-stream" />
</staticContent>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
</system.webServer>
</configuration>

@ -1,4 +1,69 @@
<?php
function is_home_page_posts_archive() {
// 1. Если главная страница - это страница записей
if (get_option('show_on_front') == 'posts') {
return true;
}
// 2. Если главная - статическая страница, но выводит архив
if (get_option('show_on_front') == 'page') {
$front_page_id = get_option('page_on_front');
// Проверяем, является ли это архивом
return is_post_type_archive_view($front_page_id);
}
return false;
}
// Дополнительная функция для проверки шаблона архива
function is_post_type_archive_view($page_id) {
$template = get_page_template_slug($page_id);
return strpos($template, 'archive') !== false ||
strpos($template, 'blog') !== false;
}
add_filter('timber/context', function($context) {
// Проверяем существование страниц
$about_page = Timber::get_post([
'post_type' => 'page',
'name' => 'o-kompanii',
'limit' => 1
]);
$production_page = Timber::get_post([
'post_type' => 'page',
'name' => 'proizvodstvo', // Обратите внимание на возможную опечатку в slug
'limit' => 1
]);
// Устанавливаем URL для страницы "О компании"
if ($about_page) {
$context['about_url'] = '/o-kompanii/';
$context['about_url_en'] = '/en/about-us/';
} else {
$context['about_url'] = 'https://cosmopet.shop/chto-takoe-entoprotein/';
$context['about_url_en'] = 'https://cosmopet.shop/en/about-2/';
}
// Устанавливаем URL для страницы "Производство"
if ($production_page) {
$context['production_url'] = '/proizvodstvo/';
$context['production_url_en'] = '/en/production/';
} else {
$context['production_url'] = 'https://cosmopet.shop/proizvodstvo/';
$context['production_url_en'] = 'https://cosmopet.shop/en/production/';
}
if (!is_home_page_posts_archive()) {
$context['front_url'] = "/";
$context['front_url_en'] = "/en/main/";
}
else{
$context['front_url'] = "https://cosmopet.shop/";
$context['front_url_en'] = "https://cosmopet.shop/en/main/";
}
return $context;
});
?>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,3 +1,10 @@
{# Получаем ID страницы блога из настроек #}
{% set posts_page_id = function('get_option', 'page_for_posts') %}
{# Получаем URL этой страницы #}
{% set blog_url = function('get_permalink', posts_page_id) %}
<header class="header white">
<div class="header__menu-block">
<div class="header__pc-menu">
@ -37,7 +44,7 @@
<div class="header__phone-menu">
<div class="header-phone-menu__item">
<a href="{% if current_lang == 'ru' %}https://cosmopet.shop{% elseif current_lang == 'en' %}https://cosmopet.shop/en/main/{% endif %}" class="header-phone-menu__title">{% if current_lang == 'ru' %}ГЛАВНАЯ{% elseif current_lang == 'en' %}MAIN{% endif %}</a>
<a href="{% if current_lang == 'ru' %}{{front_url}}{% elseif current_lang == 'en' %}{{front_url_en}}{% endif %}" class="header-phone-menu__title">{% if current_lang == 'ru' %}ГЛАВНАЯ{% elseif current_lang == 'en' %}MAIN{% endif %}</a>
</div>
{% if current_lang == 'ru' %}
@ -104,19 +111,16 @@
{% endif %}
<div class="header-phone-menu__item">
<a href="https://cosmopet.shop/chto-takoe-entoprotein/" class="header-phone-menu__title">
О COSMOPET
</a>
<a href="https://cosmopet.shop/{% if current_lang == 'ru' %}chto-takoe-entoprotein/{% elseif current_lang == 'en' %}/en/about-2/{% endif %}" class="main-menu__link">{% if current_lang == 'ru' %}О COSMOPET{% elseif current_lang == 'en' %}ABOUT COSMOPET{% endif %}</a>
<a href="{% if current_lang == 'ru' %}{{about_url}}{% elseif current_lang == 'en' %}{{about_url_en}}{% endif %}" class="main-menu__link">{% if current_lang == 'ru' %}О COSMOPET{% elseif current_lang == 'en' %}ABOUT COSMOPET{% endif %}</a>
</div>
<div class="header-phone-menu__item">
<a href=" {% if current_lang == 'ru' %}https://cosmopet.shop/proizvodstvo/{% elseif current_lang == 'en' %}https://cosmopet.shop/en/production/{% endif %}" class="header-phone-menu__title">
<a href=" {% if current_lang == 'ru' %}{{production_url}}{% elseif current_lang == 'en' %}{{production_url_en}}{% endif %}" class="header-phone-menu__title">
{% if current_lang == 'ru' %}ПРОИЗВОДСТВО{% elseif current_lang == 'en' %}PRODUCTION{% endif %}
</a>
</div>
<div class="header-phone-menu__item">
<a href="/{% if current_lang == 'en' %}en/{% endif %}" class="header-phone-menu__title">{% if current_lang == 'ru' %}БЛОГ{% elseif current_lang == 'en' %}BLOG{% endif %}</a>
<a href="{{blog_url}}" class="header-phone-menu__title">{% if current_lang == 'ru' %}БЛОГ{% elseif current_lang == 'en' %}BLOG{% endif %}</a>
</div>
</div>
</div>
@ -138,21 +142,21 @@
<ul class="main-menu">
<li class="main-menu__item">
<a href="{% if current_lang == 'ru' %}https://cosmopet.shop{% elseif current_lang == 'en' %}https://cosmopet.shop/en/main/{% endif %}" class="main-menu__link">{% if current_lang == 'ru' %}ГЛАВНАЯ{% elseif current_lang == 'en' %}MAIN{% endif %}</a>
<a href="{% if current_lang == 'ru' %}{{front_url}}{% elseif current_lang == 'en' %}{{front_url_en}}{% endif %}" class="main-menu__link">{% if current_lang == 'ru' %}ГЛАВНАЯ{% elseif current_lang == 'en' %}MAIN{% endif %}</a>
</li>
<li class="main-menu__item">
<a href="https://cosmopet.shop/{% if current_lang == 'ru' %}chto-takoe-entoprotein/{% elseif current_lang == 'en' %}/en/about-2/{% endif %}" class="main-menu__link">{% if current_lang == 'ru' %}О COSMOPET{% elseif current_lang == 'en' %}ABOUT COSMOPET{% endif %}</a>
<a href="{% if current_lang == 'ru' %}{{about_url}}{% elseif current_lang == 'en' %}{{about_url_en}}{% endif %}" class="main-menu__link">{% if current_lang == 'ru' %}О COSMOPET{% elseif current_lang == 'en' %}ABOUT COSMOPET{% endif %}</a>
</li>
<li class="main-menu__item">
<a href=" {% if current_lang == 'ru' %}https://cosmopet.shop/proizvodstvo/{% elseif current_lang == 'en' %}https://cosmopet.shop/en/production/{% endif %}" class="main-menu__link">
<a href=" {% if current_lang == 'ru' %}{{production_url}}{% elseif current_lang == 'en' %}{{production_url_en}}{% endif %}" class="main-menu__link">
{% if current_lang == 'ru' %}ПРОИЗВОДСТВО{% elseif current_lang == 'en' %}PRODUCTION{% endif %}
</a>
</li>
<li class="main-menu__item">
<a href="/{% if current_lang == 'en' %}en/{% endif %}" class="main-menu__link">{% if current_lang == 'ru' %}БЛОГ{% elseif current_lang == 'en' %}BLOG{% endif %}</a>
<a href="{{blog_url}}" class="main-menu__link">{% if current_lang == 'ru' %}БЛОГ{% elseif current_lang == 'en' %}BLOG{% endif %}</a>
</li>
<li class="main-menu__item">
<button class="main-menu__button" id="pc-menu">

Loading…
Cancel
Save