add eng blocks

This commit is contained in:
arlemp@selectel.ru
2021-12-12 19:26:50 +03:00
parent 59422e2499
commit 1500b493c9
6 changed files with 113 additions and 14 deletions

View File

@@ -23,7 +23,9 @@ if( $posts ):
<div class="right_archive"> <div class="right_archive">
<a href="<?php the_permalink(); ?>"><img width="147" class="right_archive_img" src="<?php echo get_the_post_thumbnail_url($post, 'fil');?>" alt="<?the_title();?>"></a> <a href="<?php the_permalink(); ?>"><img width="147" class="right_archive_img" src="<?php echo get_the_post_thumbnail_url($post, 'fil');?>" alt="<?the_title();?>"></a>
<div class="right_archive_text"><a href="<?php the_permalink(); ?>"><?=vij_lang('gazeta', LANG_VERSION);?></a></div> <div class="right_archive_text"><a href="<?php the_permalink(); ?>"><?=vij_lang('gazeta', LANG_VERSION);?></a></div>
<div class="right_archive_link"><a href="<?php the_permalink(); ?>"><?=the_title();?></a></div> <?if (LANG_VERSION == 'ru'):?>
<div class="right_archive_link"><a href="<?php the_permalink(); ?>"><?=the_title();?></a></div>
<?endif?>
</div> </div>

45
blocks/enmoread.php Normal file
View File

@@ -0,0 +1,45 @@
<?php
$posts = get_posts( array(
'numberposts' => 4,
'category' => 4782, // англ статьи
'orderby' => 'date',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'post__not_in' => array($post_id),
'meta_query' => array(
array(
'key' => '_thumbnail_id',
//'compare' => 'EXISTS'
)
),
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
# вывод поста
if( $posts ):?>
<div class="moread_rubric">Read also:</div>
<div class="moread">
<?php foreach($posts as $post):
setup_postdata( $post );?>
<div class="moread_card">
<img src="<?php echo get_the_post_thumbnail_url($post);?>" alt="<?the_title();?>">
<div class="moread_title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></div>
<div class="moread_date"><?echo mysql2date( 'j M Y H:i', $post->post_date, false );?></div>
</div>
<?php endforeach;?>
</div>
<?php wp_reset_postdata();
endif?>

View File

@@ -7,6 +7,7 @@
$mosts = get_posts( array( $mosts = get_posts( array(
'numberposts' => 3, 'numberposts' => 3,
'post__in' => get_option( 'sticky_posts' ), 'post__in' => get_option( 'sticky_posts' ),
'cat' => '-4782',
'orderby' => 'date', 'orderby' => 'date',
'order' => 'DESC', 'order' => 'DESC',
'include' => array(), 'include' => array(),

34
blocks/regulation.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
# три последних эвента
$posts = get_posts( array(
'numberposts' => 2,
'category' => 4784,
'post_type' => 'post',
//'post_status' => 'publish, future',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
# вывод поста
if( $posts ):?>
<div class="publs_right">
<div class="publs_right_title">Guidance and regulation</div>
<?foreach($posts as $post):
setup_postdata( $post );
?>
<div class="publs_right_item">
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
</div>
<?php endforeach;?>
</div>
<?wp_reset_postdata();
endif;

View File

@@ -7,14 +7,19 @@
<div id="left"> <div id="left">
<?php // include VIJ_CACHE.'leftmenu.html';?>
<?php get_template_part( '/blocks/leftmenu');?>
<?php get_template_part( '/blocks/opinion', null, ['subclass' => '']);?> <?php // include VIJ_CACHE.'leftmenu.html';?>
<?php get_template_part( '/blocks/citats')?> <?php get_template_part( '/blocks/leftmenu');?>
<?php //include VIJ_CACHE.'opinion.html';?>
<?php //get_template_part( '/blocks/citata', null, ['subclass' => '']);?> <?if (LANG_VERSION == 'ru'):?>
<?php get_template_part( '/blocks/events');?> <?php get_template_part( '/blocks/opinion', null, ['subclass' => '']);?>
<?php //include VIJ_CACHE.'events.html';?> <?php get_template_part( '/blocks/citats')?>
<?php //include VIJ_CACHE.'opinion.html';?>
<?php //get_template_part( '/blocks/citata', null, ['subclass' => '']);?>
<?php get_template_part( '/blocks/events');?>
<?php //include VIJ_CACHE.'events.html';?>
<?endif?>
<div class="right-info"> <div class="right-info">
<a href="https://vetandlife.ru/vetspetsialist-sportsmenka-i-prosto-kras/"> <a href="https://vetandlife.ru/vetspetsialist-sportsmenka-i-prosto-kras/">
@@ -82,12 +87,24 @@
<?if (LANG_VERSION == 'en'){
get_template_part( '/blocks/regulation');
}
else {
get_template_part( '/blocks/zakons');
}
?>
<?php get_template_part( '/blocks/zakons');?>
<?php //include VIJ_CACHE.'zakons.html';?> <?php //include VIJ_CACHE.'zakons.html';?>
<?get_template_part( '/blocks/mosts', null, ['subclass' => '']);?> <?if (LANG_VERSION == 'en'):?>
<?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?> <?get_template_part( '/blocks/enmosts', null, ['subclass' => '']);?>
<?get_template_part( '/blocks/enmosts', null, ['subclass' => 'mob-lite']);?>
<?else:?>
<?get_template_part( '/blocks/mosts', null, ['subclass' => '']);?>
<?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?>
<?endif?>
<?//php include VIJ_CACHE.'mosts.html';?> <?//php include VIJ_CACHE.'mosts.html';?>
</div> </div>
</div><!-- end main --> </div><!-- end main -->

View File

@@ -73,7 +73,7 @@
</div> </div>
</div> </div>
<?php //include get_template_directory().'/blocks/moread.php';?> <?php include get_template_directory().'/blocks/enmoread.php';?>
<div class="publ-to-main"> <div class="publ-to-main">
<button class="more_button" onclick="location.href='<?=get_site_url()?>/en'" type="button"> <button class="more_button" onclick="location.href='<?=get_site_url()?>/en'" type="button">