add zakons

This commit is contained in:
arlemp@selectel.ru
2021-11-02 13:01:47 +03:00
parent a1d4618545
commit d5100fe2b6
4 changed files with 71 additions and 6 deletions

34
blocks/zakons.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
# три последних эвента
$posts = get_posts( array(
'numberposts' => 2,
'category' => 6,
'post_type' => 'post',
//'post_status' => 'publish, future',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
# вывод поста
if( $posts ):?>
<div class="publs_right">
<div class="publs_right_title">Законодательство</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;