add eng version
This commit is contained in:
47
blocks/gamburger.php
Normal file
47
blocks/gamburger.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (LANG_VERSION == 'en'){
|
||||||
|
$left_mob_menu = 'leftenmenu';
|
||||||
|
$gamburger_menu = 4789;
|
||||||
|
$part_title = 'Parts';
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$left_mob_menu = 'leftmenu';
|
||||||
|
$gamburger_menu = 23;
|
||||||
|
$part_title = 'Рубрики';
|
||||||
|
}
|
||||||
|
|
||||||
|
//$menu_items = wp_get_nav_menu_items($gamburger_menu);?>
|
||||||
|
|
||||||
|
<?php $menu_items = wp_get_nav_menu_items($gamburger_menu);?>
|
||||||
|
|
||||||
|
<div id="mobile_main_menu">
|
||||||
|
|
||||||
|
<div class="main_main">
|
||||||
|
<ul id="gamburer_menu" class="menu">
|
||||||
|
<li id="rubrics_start"><a href="#"><?=$part_title?><span class="rub_arrow">></span></a></li>
|
||||||
|
<?foreach ($menu_items as $item):?>
|
||||||
|
<li><a href="<?=$item->url?>"><?=$item->title?></a></li>
|
||||||
|
<?endforeach?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php /**wp_nav_menu( array(
|
||||||
|
'container_class' => 'main_main',
|
||||||
|
'menu' => 'mob_topmenu',
|
||||||
|
'menu_id' => 'gamburer_menu'
|
||||||
|
) ); **/?>
|
||||||
|
|
||||||
|
<div id="closed_mobile_menu"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="mobile_rubrics_menu">
|
||||||
|
<div id='rubrics_back'><strong><</strong> <span class="rub_back_title">назад</span></div>
|
||||||
|
<?php wp_nav_menu( array(
|
||||||
|
'menu_class'=>'menu_left',
|
||||||
|
'menu'=>$left_mob_menu
|
||||||
|
));?>
|
||||||
|
|
||||||
|
<div id="closed_mobile_rubrics_menu"></div>
|
||||||
|
</div>
|
||||||
@@ -1,37 +1,8 @@
|
|||||||
<header>
|
<header>
|
||||||
|
|
||||||
<?php $menu_items = wp_get_nav_menu_items(23);?>
|
|
||||||
|
|
||||||
<div id="mobile_main_menu">
|
<?php include TEMPLATEPATH.'/blocks/gamburger.php'; ?>
|
||||||
|
|
||||||
<div class="main_main">
|
|
||||||
<ul id="gamburer_menu" class="menu">
|
|
||||||
<li id="rubrics_start"><a href="#">Рубрики<span class="rub_arrow">></span></a></li>
|
|
||||||
<?foreach ($menu_items as $item):?>
|
|
||||||
<li><a href="<?=$item->url?>"><?=$item->title?></a></li>
|
|
||||||
<?endforeach?>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php /**wp_nav_menu( array(
|
|
||||||
'container_class' => 'main_main',
|
|
||||||
'menu' => 'mob_topmenu',
|
|
||||||
'menu_id' => 'gamburer_menu'
|
|
||||||
) ); **/?>
|
|
||||||
|
|
||||||
<div id="closed_mobile_menu"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="mobile_rubrics_menu">
|
|
||||||
<div id='rubrics_back'><strong><</strong> <span class="rub_back_title">назад</span></div>
|
|
||||||
<?php wp_nav_menu( array(
|
|
||||||
'menu_class'=>'menu_left',
|
|
||||||
'theme_location'=>'left'
|
|
||||||
));?>
|
|
||||||
|
|
||||||
<div id="closed_mobile_rubrics_menu"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="mainlogo">
|
<div id="mainlogo">
|
||||||
<a href="<?php echo home_url(); ?>"><img width="240" src = "<?=get_stylesheet_directory_uri()?>/pub/logo/vij_logo.svg" alt = "Ветеринария и жизнь. Газета и сайт" /></a>
|
<a href="<?php echo home_url(); ?>"><img width="240" src = "<?=get_stylesheet_directory_uri()?>/pub/logo/vij_logo.svg" alt = "Ветеринария и жизнь. Газета и сайт" /></a>
|
||||||
</div>
|
</div>
|
||||||
@@ -72,6 +43,12 @@
|
|||||||
<a href="<?=get_site_url()?>?s="><li class="btn_search"></li></a>
|
<a href="<?=get_site_url()?>?s="><li class="btn_search"></li></a>
|
||||||
<a href="<?=get_site_url()?>/feed"><li class="btn_rss"></li></a>
|
<a href="<?=get_site_url()?>/feed"><li class="btn_rss"></li></a>
|
||||||
<li class="toggle-nav" id="toggle-nav"></li>
|
<li class="toggle-nav" id="toggle-nav"></li>
|
||||||
|
<?if (LANG_VERSION == 'en'):?>
|
||||||
|
<a href="<?=get_site_url()?>"><li class="btn_lan">РУС</li></a>
|
||||||
|
<?else:?>
|
||||||
|
<a href="<?=get_site_url()?>/en"><li class="btn_lan">EN</li></a>
|
||||||
|
<?endif?>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,18 @@
|
|||||||
|
|
||||||
<div class="menu-left-block">
|
<div class="menu-left-block">
|
||||||
|
|
||||||
|
<?
|
||||||
|
if (LANG_VERSION == 'en'){
|
||||||
|
$left_menu = 'leftenmenu';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$left_menu = 'leftmenu';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php wp_nav_menu( array(
|
<?php wp_nav_menu( array(
|
||||||
'menu_class'=>'menu_left',
|
'menu_class'=>'menu_left',
|
||||||
'theme_location'=>'left',
|
|
||||||
'menu' => $left_menu
|
'menu' => $left_menu
|
||||||
));?>
|
));?>
|
||||||
</div>
|
</div>
|
||||||
@@ -14,8 +14,11 @@
|
|||||||
|
|
||||||
# вывод поста
|
# вывод поста
|
||||||
if( $posts ):?>
|
if( $posts ):?>
|
||||||
|
<?if (LANG_VERSION == 'en'):?>
|
||||||
<div class="yets_rubric">Еще по теме</div>
|
<div class="yets_rubric">More on the topic</div>
|
||||||
|
<?else:?>
|
||||||
|
<div class="yets_rubric">Еще по теме</div>
|
||||||
|
<?endif?>
|
||||||
|
|
||||||
<div class="yets">
|
<div class="yets">
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ $nn = 0;?>
|
|||||||
<h2 class="main-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
<h2 class="main-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
||||||
<div class="main-card-body">
|
<div class="main-card-body">
|
||||||
<div class="main-card-text"><a href="<?the_permalink();?>"><?the_excerpt();?></a></div>
|
<div class="main-card-text"><a href="<?the_permalink();?>"><?the_excerpt();?></a></div>
|
||||||
<div class="news_date"><?the_time('j F Y, G:i');?></div>
|
<div class="news_date"><?echo mysql2date( 'j F Y, H:i', $post->post_date, false );?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ $nn = 0;?>
|
|||||||
<?endif?>
|
<?endif?>
|
||||||
<h2 class="mini-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
<h2 class="mini-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
||||||
<div class="mini-card-body">
|
<div class="mini-card-body">
|
||||||
<div class="news_date"><?the_time('j F Y, G:i');?></div>
|
<div class="news_date"><?echo mysql2date( 'j F Y, H:i', $post->post_date, false );?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -484,6 +484,28 @@ function citata_title($percon){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# helper find perevod author
|
||||||
|
function find_perevod($post_id){
|
||||||
|
|
||||||
|
$author = '';
|
||||||
|
|
||||||
|
$perevod_name = get_post_meta( $post_id, 'perevod_name', true );
|
||||||
|
if ( ! empty ( $perevod_name )){
|
||||||
|
$user_info = get_userdata($perevod_name);
|
||||||
|
if (isset($user_info->display_name)){
|
||||||
|
$author = $user_info->display_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($author !== ''){
|
||||||
|
return " / Translated by $author";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
add_action( 'pre_get_posts', function ($query) {
|
add_action( 'pre_get_posts', function ($query) {
|
||||||
|
|
||||||
|
|||||||
18
header.php
18
header.php
@@ -4,7 +4,7 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title>
|
<title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title>
|
||||||
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=92">
|
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=96">
|
||||||
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
||||||
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/jquery-3.6.0.min.js"></script>
|
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/jquery-3.6.0.min.js"></script>
|
||||||
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/golos.js"></script>
|
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/golos.js"></script>
|
||||||
@@ -29,6 +29,22 @@
|
|||||||
</noscript>
|
</noscript>
|
||||||
<!-- End Facebook Pixel Code -->
|
<!-- End Facebook Pixel Code -->
|
||||||
|
|
||||||
|
<? $lang_version = lang_version();
|
||||||
|
|
||||||
|
if ($lang_version == 'en'){
|
||||||
|
$mainmenu = 'topenmenu';
|
||||||
|
$mob_main_menu = 'topenmenu';
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$mainmenu = 'topmenu';
|
||||||
|
$mob_main_menu = 'mob_rubrics';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
define('LANG_VERSION', $lang_version);
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
<?php include TEMPLATEPATH.'/blocks/header.php';
|
<?php include TEMPLATEPATH.'/blocks/header.php';
|
||||||
//get_template_part( '/blocks/header.php');?>
|
//get_template_part( '/blocks/header.php');?>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<div class="post_info">
|
<div class="post_info">
|
||||||
<div class="post_info_sub">
|
<div class="post_info_sub">
|
||||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>, <? echo mysql2date( 'j F Y H:i', $post->post_date, false );?>
|
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>, <? echo mysql2date( 'j M Y H:i', $post->post_date, false );?>
|
||||||
</div>
|
</div>
|
||||||
<div class="post_info_sub post_info_social"
|
<div class="post_info_sub post_info_social"
|
||||||
<?php include get_template_directory().'/blocks/social-share.php';?>
|
<?php include get_template_directory().'/blocks/social-share.php';?>
|
||||||
@@ -35,10 +35,15 @@
|
|||||||
<?$author = get_the_author();
|
<?$author = get_the_author();
|
||||||
if ( ! empty ( $author ) AND $author !== 'vetandlife.ru'):?>
|
if ( ! empty ( $author ) AND $author !== 'vetandlife.ru'):?>
|
||||||
<div class="post_author">
|
<div class="post_author">
|
||||||
By <?php the_author(); ?>
|
By <?php the_author(); ?><?=find_perevod($post->ID)?>
|
||||||
</div>
|
</div>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="publ_expert"><?php the_excerpt();?></div>
|
<div class="publ_expert"><?php the_excerpt();?></div>
|
||||||
<?if ( has_post_thumbnail() ) :?>
|
<?if ( has_post_thumbnail() ) :?>
|
||||||
<div id="post-img">
|
<div id="post-img">
|
||||||
@@ -61,18 +66,18 @@
|
|||||||
|
|
||||||
<div class="post_panel_info">
|
<div class="post_panel_info">
|
||||||
<div class="post_panel_info_sub">
|
<div class="post_panel_info_sub">
|
||||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>, <?php echo mysql2date( 'j F Y H:i', $post->post_date, false );?>
|
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>, <?php echo mysql2date( 'j M Y H:i', $post->post_date, false );?>
|
||||||
</div>
|
</div>
|
||||||
<div class="post_panel_info_sub">
|
<div class="post_panel_info_sub">
|
||||||
<!--Поделиться <i class="fas fa-share-square btn_soc_post"></i>--> <?php include get_template_directory().'/blocks/social-share.php';?>
|
<!--Поделиться <i class="fas fa-share-square btn_soc_post"></i>--> <?php include get_template_directory().'/blocks/social-share.php';?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include get_template_directory().'/blocks/moread.php';?>
|
<?php //include get_template_directory().'/blocks/moread.php';?>
|
||||||
|
|
||||||
<div class="publ-to-main">
|
<div class="publ-to-main">
|
||||||
<button class="more_button" onclick="location.href='<?=get_site_url()?>/page/2'" type="button">
|
<button class="more_button" onclick="location.href='<?=get_site_url()?>/en'" type="button">
|
||||||
На главную</button>
|
Mainpage</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
31
style.css
31
style.css
@@ -646,27 +646,27 @@ a{
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-item-11{
|
.menu-item-11, .menu-item-17474{
|
||||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/molotok.svg) left center;
|
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/molotok.svg) left center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-item-11:hover{
|
.menu-item-11:hover, .menu-item-17474:hover{
|
||||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/molotok-orange.svg) left center;
|
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/molotok-orange.svg) left center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-item-12{
|
.menu-item-12, .menu-item-17473{
|
||||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/epizoo.svg) left center;
|
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/epizoo.svg) left center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-item-12:hover{
|
.menu-item-12:hover, .menu-item-17473:hover{
|
||||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/epizoo-orange.svg) left center;
|
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/epizoo-orange.svg) left center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-item-15{
|
.menu-item-15, .menu-item-17475{
|
||||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/zoo.svg) left center;
|
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/zoo.svg) left center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-item-15:hover{
|
.menu-item-15:hover, .menu-item-17475:hover{
|
||||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/zoo-orange.svg) left center;
|
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/zoo-orange.svg) left center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,6 +861,15 @@ a{
|
|||||||
height: 15px;
|
height: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn_rss{
|
||||||
|
background: url(/wp-content/themes/vij/pub/icons/header-rss.png) no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn_lan{
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: -4px;
|
||||||
|
}
|
||||||
|
|
||||||
#copy{
|
#copy{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -877,11 +886,6 @@ a{
|
|||||||
background: url(/wp-content/themes/vij/pub/icons/union.png) no-repeat;
|
background: url(/wp-content/themes/vij/pub/icons/union.png) no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.btn_rss{
|
|
||||||
background: url(/wp-content/themes/vij/pub/icons/header-rss.png) no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#content{
|
#content{
|
||||||
margin-right: 58px;
|
margin-right: 58px;
|
||||||
@@ -1986,6 +1990,7 @@ span.rub_back_title{
|
|||||||
.toggle-nav {
|
.toggle-nav {
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
background: url(/wp-content/themes/vij/pub/icons/burger-15.png) no-repeat;
|
background: url(/wp-content/themes/vij/pub/icons/burger-15.png) no-repeat;
|
||||||
|
padding-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn_rss{
|
.btn_rss{
|
||||||
@@ -2158,13 +2163,15 @@ span.rub_back_title{
|
|||||||
#header_icons li{
|
#header_icons li{
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 15px;
|
height: 15px;
|
||||||
margin-left: 6px;
|
margin-left: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.toggle-nav {
|
.toggle-nav {
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
background: url(/wp-content/themes/vij/pub/icons/burger-15.png) no-repeat;
|
background: url(/wp-content/themes/vij/pub/icons/burger-15.png) no-repeat;
|
||||||
|
padding-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user