add eng menus

This commit is contained in:
2021-12-09 17:59:30 +03:00
parent f989783b48
commit aba07a8e1b
6 changed files with 103 additions and 9 deletions

View File

@@ -41,12 +41,14 @@
<? $lang_version = lang_version(); <? $lang_version = lang_version();
if ($lang_version == 'en'){ if ($lang_version == 'en'){
$mainmenu = 'en_main'; $mainmenu = 'topenmenu';
$mob_main_menu = 'en_main'; $mob_main_menu = 'topenmenu';
$left_menu = 'leftenmenu';
} }
else { else {
$mainmenu = 'topmenu'; $mainmenu = 'topmenu';
$mob_main_menu = 'mob_rubrics'; $mob_main_menu = 'mob_rubrics';
$left_menu = 'leftmenu';
} }
?> ?>

View File

@@ -2,6 +2,7 @@
<div class="menu-left-block"> <div class="menu-left-block">
<?php wp_nav_menu( array( <?php wp_nav_menu( array(
'menu_class'=>'menu_left', 'menu_class'=>'menu_left',
'theme_location'=>'left' 'theme_location'=>'left',
'menu' => $left_menu
));?> ));?>
</div> </div>

View File

@@ -448,9 +448,15 @@ function lang_version(){
} }
} }
//elseif (is_single()){ elseif (is_single()){
// echo 'Пост';
// } $current_cat = get_the_category( get_the_ID() )[0];
if ($current_cat->parent == 4782 or $current_cat->term_id == 4782 ){
return 'en';
}
}
return 'ru'; return 'ru';

85
single-4782.php Normal file
View File

@@ -0,0 +1,85 @@
<?php get_header();?>
<div id="content">
<?//while(have_posts()):?>
<?the_post();?>
<?php $category = get_the_category();
$category_id = $category[0]->term_id;
$category_link = get_category_link($category_id);
$post_id = get_the_ID();
?>
<ul id="nav_content">
<li><a href="<?=get_site_url()?>/en">English version</li>
<li>-<li>
<li><a href="<?=$category_link?>"><?=$category['0']->name;?></a></li>
<li>-<li>
<li><?=mb_substr(get_the_title(), 0, 50);?>...</li>
</ul>
<div class="post_info">
<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 );?>
</div>
<div class="post_info_sub post_info_social"
<?php include get_template_directory().'/blocks/social-share.php';?>
</div>
</div>
<h1 class="post-h1"><?php wp_title('');?></h1>
<?$author = get_the_author();
if ( ! empty ( $author ) AND $author !== 'vetandlife.ru'):?>
<div class="post_author">
By <?php the_author(); ?>
</div>
<?endif?>
<div class="publ_expert"><?php the_excerpt();?></div>
<?if ( has_post_thumbnail() ) :?>
<div id="post-img">
<img class="img-fluid rounded" src="<?php echo get_the_post_thumbnail_url(null, 'full');?>" alt="<?the_title();?>">
</div>
<div class="post_img_title"><?the_post_thumbnail_caption()?></div>
<?endif?>
<div class="fulltext">
<?the_content();?>
</div>
<!--<p><small class="text-muted"><?php the_tags('');?></small></p> -->
<?//endwhile;?>
<?php include get_template_directory().'/blocks/yets.php';?>
<div id="tags">
<?php the_tags('Tags: ');?>
</div>
<div class="post_panel_info">
<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 );?>
</div>
<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';?>
</div>
</div>
<?php include get_template_directory().'/blocks/moread.php';?>
<div class="publ-to-main">
<button class="more_button" onclick="location.href='<?=get_site_url()?>/page/2'" type="button">
На главную</button>
</div>
</div>
<?php get_footer();?>

View File

@@ -1,7 +1,7 @@
<?php <?php
ini_set('display_errors','off'); //ini_set('display_errors','off');
error_reporting(E_ALL); //error_reporting(E_ALL);
require '/vhosts/beta/wp-load.php'; require '/vhosts/beta/wp-load.php';
//require '/thosts/vij/wp/wp-load.php'; //require '/thosts/vij/wp/wp-load.php';

View File

@@ -64,7 +64,7 @@ function perevod_post_meta_boxes_setup() {
function perevod_post_class_meta_box( $post ) {?> function perevod_post_class_meta_box( $post ) {?>
<?$args = array( <?$args = array(
'role__in' => array( administrator, author, editor ), 'role__in' => array( 'administrator', 'author', 'editor' ),
'orderby' => 'display_name', 'orderby' => 'display_name',
'order' => 'ASC', 'order' => 'ASC',
); );