new logic yets and moread

This commit is contained in:
arlemp@selectel.ru
2022-08-17 00:29:25 +03:00
parent 00164c05f1
commit ad4a7febdb
4 changed files with 43 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
<?php
$posts = get_posts( array(
'numberposts' => 4,
'numberposts' => 6,
'category' => 2, // пока тольео события
'orderby' => 'date',
'order' => 'DESC',
@@ -21,16 +21,18 @@ $posts = get_posts( array(
) );
# вывод поста
if( $posts ):?>
if( $posts ):
$nr = 0;?>
<div class="moread_rubric">Читайте также:</div>
<div class="moread">
<?php foreach($posts as $post):
$nr++;
setup_postdata( $post );?>
<div class="moread_card">
<div class="moread_card" id="moread_<?=$nr?>">
<img src="<?php echo get_the_post_thumbnail_url($post);?>" alt="<?the_title();?>">
<div class="moread_title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></div>
<div class="moread_date"><?the_time('j F Y, G:i');?></div>