add en mobile menu
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<div class="content-middle articles-wrapper">
|
<div class="content-middle articles-wrapper">
|
||||||
<?php include(get_template_directory().'/en/pinned-post-mob-en.php');?>
|
<?php include(get_template_directory().'/en/pinned-post-mob-en.php');?>
|
||||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
<?php get_template_part('en/rubrics-mobile-en'); ?>
|
||||||
<div class="articles-preview">
|
<div class="articles-preview">
|
||||||
<?php
|
<?php
|
||||||
$args = array(
|
$args = array(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php get_header( 'en' ); ?>
|
<?php get_header( 'en' ); ?>
|
||||||
<div class="content-middle articles-wrapper">
|
<div class="content-middle articles-wrapper">
|
||||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
<?php get_template_part('en/rubrics-mobile-en'); ?>
|
||||||
<div class="section-title desktop">
|
<div class="section-title desktop">
|
||||||
<?php if (is_category()) : ?>
|
<?php if (is_category()) : ?>
|
||||||
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
|
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
|
||||||
|
|||||||
59
en/rubrics-mobile-en.php
Normal file
59
en/rubrics-mobile-en.php
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
$arg_cat = array(
|
||||||
|
'include' => EN_PARTS,
|
||||||
|
'order' => 'ASC',
|
||||||
|
'taxonomy' => 'category',
|
||||||
|
'hide_empty' => false
|
||||||
|
);
|
||||||
|
$categories = get_categories($arg_cat);
|
||||||
|
$current_term = get_queried_object();
|
||||||
|
|
||||||
|
// Получаем ID текущей категории или категорий поста
|
||||||
|
$current_term_ids = [];
|
||||||
|
if (is_single()) {
|
||||||
|
$current_term_ids = wp_get_post_categories($current_term->ID);
|
||||||
|
} elseif (is_category()) {
|
||||||
|
$current_term_ids[] = $current_term->term_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$firstElement = array_shift($categories);
|
||||||
|
array_push($categories, $firstElement);
|
||||||
|
?>
|
||||||
|
<div class="menu-vertical mobile">
|
||||||
|
<div class="menu-vertical__head">
|
||||||
|
<?php if (is_category(740)) : ?>
|
||||||
|
<span>Parts</span>
|
||||||
|
<?php elseif (is_category()) : ?>
|
||||||
|
<span><?= $current_term->name; ?></span>
|
||||||
|
<?php elseif (is_single()) :?>
|
||||||
|
<span><?= get_cat_name($current_term_ids[0]); ?></span>
|
||||||
|
<?php else : ?>
|
||||||
|
<span>Parts</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_373_15802)">
|
||||||
|
<path d="M7 10L12 15L17 10" stroke="#7C7C7C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_373_15802">
|
||||||
|
<rect width="24" height="24" fill="white" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="menu-vertical__inner">
|
||||||
|
<? foreach ($categories ?? [] as $cat) : ?>
|
||||||
|
<? if ($cat->slug === 'uncategorized') continue; ?>
|
||||||
|
<?
|
||||||
|
$icon = get_field('icon', 'category_' . $cat->term_id);
|
||||||
|
$bg_image = get_field('bg_image', 'category_' . $cat->term_id);
|
||||||
|
$class = in_array($cat->term_id, $current_term_ids) ? 'is-active' : '';
|
||||||
|
?>
|
||||||
|
<a href="<?= get_category_link($cat->term_id); ?>" class="menu-vertical__item <?= $class ?>" <span class="menu-vertical__item-icon">
|
||||||
|
<img src="<?= $icon ?>" alt="" />
|
||||||
|
</span>
|
||||||
|
<span class="menu-vertical__item-text"><?= $cat->name ?></span>
|
||||||
|
</a>
|
||||||
|
<? endforeach; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -102,7 +102,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
|||||||
</div>
|
</div>
|
||||||
<div class="header-mobile">
|
<div class="header-mobile">
|
||||||
<nav class="nav header-mobile__nav">
|
<nav class="nav header-mobile__nav">
|
||||||
<?php //get_template_part('partials/menu-primary'); ?>
|
<?php get_template_part('partials/menu-primary'); ?>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="socials header-mobile__socials">
|
<div class="socials header-mobile__socials">
|
||||||
<?php get_template_part('partials/menu-socials'); ?>
|
<?php get_template_part('partials/menu-socials'); ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user