Files
vij/blocks/archive.php

35 lines
977 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
$posts = get_posts( array(
'numberposts' => 1,
'category' => 3, // 19 - архив газеты
'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="right_archive">
<img width="280" class="right_archive_img" src="<?php echo get_the_post_thumbnail_url($post, 'left-thumb');?>" alt="<?the_title();?>">
<div class="right_archive_text">Читать газету<br>«Ветеринария и Жизнь»</div>
<div class="right_archive_link"><a href="<?php the_permalink(); ?>">cвежий номер</a></div>
</div>
<?php endforeach;
wp_reset_postdata();
endif;