Files
vij/blocks/citata.php

38 lines
983 B
PHP
Raw Normal View History

2021-09-20 01:07:53 +03:00
<?php
2021-09-27 00:07:02 +03:00
$key = 'vij_citata';
if (!$posts = kuri_set($key)) {
$posts = get_posts( array(
'numberposts' => 1,
2021-10-09 13:05:18 +03:00
'category' => 30, // 7 - мнения
2021-09-27 00:07:02 +03:00
'orderby' => 'date',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
));
kuri_set($key, $posts);
}
2021-09-20 01:07:53 +03:00
# вывод поста
if( $posts ):
2021-09-27 00:07:02 +03:00
foreach($posts as $post):?>
2021-09-20 01:07:53 +03:00
2021-09-28 22:25:21 +03:00
<div class="left_citata<?if ($args['subclass'] !== '') echo ' '.$args['subclass'];?>">
2021-09-20 01:07:53 +03:00
<div class="left_citata_title">цитата</div>
<img class="left_preview" src="<?php echo get_the_post_thumbnail_url($post, 'left-thumb');?>" alt="<?the_title();?>">
2021-09-27 00:07:02 +03:00
<div class="left_citata_text"><a href="<?=get_permalink($post);?>">«<?=$post->post_title;?>»</a></div>
2021-09-20 01:07:53 +03:00
</div>
<?php endforeach;
endif;