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

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;