add card_post_id
This commit is contained in:
31
blocks/card_post_id.php
Normal file
31
blocks/card_post_id.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
|
||||
function card_post_id( $id, $news_date = '') {
|
||||
|
||||
$curr_post = get_post( $id );?>
|
||||
|
||||
|
||||
<div class="mini-card">
|
||||
<?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?>
|
||||
</a>
|
||||
</div>
|
||||
<?endif?>
|
||||
<h2 class="mini-card-title"><a href="<?the_permalink($curr_post->ID);?>"><?=$curr_post->post_title?></a></h2>
|
||||
<div class="mini-card-body">
|
||||
<div class="news_date">
|
||||
<?if ($news_date == ''):?>
|
||||
<?=get_the_time('j F Y, G:i', $curr_post->ID);?>
|
||||
<?else:?>
|
||||
<?=$news_date?>
|
||||
<?endif?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?}?>
|
||||
Reference in New Issue
Block a user