new logic yets and moread
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php $posts = get_posts( array(
|
||||
'numberposts' => 4,
|
||||
'numberposts' => 6,
|
||||
'category' => $category_id, // текущая рубрика
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
@@ -13,7 +13,9 @@
|
||||
) );
|
||||
|
||||
# вывод поста
|
||||
if( $posts ):?>
|
||||
if( $posts ):
|
||||
|
||||
$nn = 0;?>
|
||||
|
||||
|
||||
<div class="yets_rubric"><?=vij_lang('more', LANG_VERSION)?></div>
|
||||
@@ -21,9 +23,10 @@ if( $posts ):?>
|
||||
<div class="yets">
|
||||
|
||||
<?php foreach($posts as $post):
|
||||
setup_postdata( $post );?>
|
||||
setup_postdata( $post );
|
||||
$nn++;?>
|
||||
|
||||
<div class="yet_card">
|
||||
<div class="yet_card" id="yets-<?=$nn?>">
|
||||
<div class="yet_title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user