add blocks cache

This commit is contained in:
2023-07-28 11:59:42 +03:00
parent 83a2fcaa32
commit 85bdf0d8f2
8 changed files with 53 additions and 62 deletions

View File

@@ -10,9 +10,9 @@ $curr_post = get_post( $id );?>
<?if ( has_post_thumbnail($curr_post->ID) ) :?>
<div class="mini-card-img">
<a href="<?the_permalink($curr_post->ID);?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url($curr_post->ID); ?>" alt="<?=$curr_post->post_title;?>">
<?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span>
<?endif?>
<?//if( has_tag( 'видео' ) ):
// echo '<span class="play-card"></span>';
//endif?>
</a>
</div>
<?endif?>

View File

@@ -2,7 +2,7 @@
# три последних эвента
$posts = get_posts( array(
$zakon_posts = get_posts( array(
'numberposts' => 2,
'category' => 6,
'post_type' => 'post',
@@ -11,24 +11,22 @@ $posts = get_posts( array(
) );
# вывод поста
if( $posts ):?>
if( $zakon_posts ):?>
<div class="publs_right">
<div class="publs_right_title">Законодательство</div>
<?foreach($posts as $post):
setup_postdata( $post );
<?foreach($zakon_posts as $zakon):
//setup_postdata( $post );
?>
<div class="publs_right_item">
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
<a href="<?=get_permalink($zakon);?>"><?php echo $zakon->post_title;?></a>
</div>
<?php endforeach;?>
</div>
<?wp_reset_postdata();
endif;
<?endif;?>