34 lines
885 B
PHP
34 lines
885 B
PHP
<?php
|
|
|
|
$posts = get_posts( array(
|
|
'numberposts' => 1,
|
|
'category' => 7, // 7 - мнения
|
|
'orderby' => 'date',
|
|
'order' => 'DESC',
|
|
'include' => array(),
|
|
'exclude' => array(),
|
|
'meta_key' => '',
|
|
'meta_value' =>'',
|
|
'post_type' => 'post',
|
|
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
|
) );
|
|
|
|
# вывод поста
|
|
if( $posts ):
|
|
|
|
foreach($posts as $post):
|
|
setup_postdata( $post );
|
|
?>
|
|
|
|
<div class="left_citata">
|
|
<div class="left_citata_title">цитата</div>
|
|
<img class="left_preview" src="<?php echo get_the_post_thumbnail_url($post, 'left-thumb');?>" alt="<?the_title();?>">
|
|
<div class="left_citata_text"><a href="<?php the_permalink(); ?>">«<?php the_title();?>»</a></div>
|
|
</div>
|
|
|
|
<?php endforeach;
|
|
|
|
wp_reset_postdata();
|
|
|
|
endif;
|