From 59556384f37b8342563f556e71b29a55280c1b00 Mon Sep 17 00:00:00 2001 From: "arlemp@selectel.ru" Date: Mon, 6 Dec 2021 21:51:01 +0300 Subject: [PATCH] add en menu --- blocks/header.php | 23 ++++++++++++++++++----- blocks/social-share.php | 2 +- functions.php | 23 +++++++++++++++++++++++ header.php | 2 +- index.php | 5 +---- 5 files changed, 44 insertions(+), 11 deletions(-) diff --git a/blocks/header.php b/blocks/header.php index c8bcf9a..5816387 100644 --- a/blocks/header.php +++ b/blocks/header.php @@ -4,19 +4,32 @@ Ветеринария и жизнь. Газета и сайт - diff --git a/blocks/social-share.php b/blocks/social-share.php index 7edd2eb..e824944 100644 --- a/blocks/social-share.php +++ b/blocks/social-share.php @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/functions.php b/functions.php index e4000d7..32d4622 100644 --- a/functions.php +++ b/functions.php @@ -435,6 +435,29 @@ function filter_nav_menu_item_title( $title, $item, $args, $depth ) { } + +function lang_version(){ + + + if (is_category()){ + $category = get_queried_object(); + + if ($category->parent == 4782 or $category->term_id == 4782 ){ + return 'en'; + } + + } + //elseif (is_single()){ + // echo 'Пост'; + // } + + + return 'ru'; + + +} + + add_action( 'pre_get_posts', function ($query) { if ( ! is_admin() && $query->is_main_query() ) { diff --git a/header.php b/header.php index bc31ddf..15afba9 100644 --- a/header.php +++ b/header.php @@ -7,7 +7,7 @@ - + diff --git a/index.php b/index.php index 995f6a5..c18ab86 100644 --- a/index.php +++ b/index.php @@ -7,9 +7,6 @@ get_header(); $nn = 0;?> - - -

Главное

@@ -80,7 +77,7 @@ $nn = 0;?> 'mob-lite']);?> - 'mob-lite']);?> + 'mob-lite']);?> 'mob-lite']);?>