Initial commit
This commit is contained in:
24
partials/pinned-post.php
Normal file
24
partials/pinned-post.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// Получаем объект закрепленного поста из ACF поля 'pinned_post'
|
||||
$pinned_post = get_field('pinned_post', 'options');
|
||||
|
||||
if ($pinned_post) :
|
||||
?>
|
||||
|
||||
<a href="<?php echo get_permalink($pinned_post->ID); ?>" class="hero-banner">
|
||||
<div class="hero-banner__bg">
|
||||
<?= show_post_image($pinned_post->ID, 'large'); ?>
|
||||
</div>
|
||||
<p class="hero-banner__main">Главное</p>
|
||||
<div class="hero-banner__content">
|
||||
<p class="hero-banner__title subtitle-16">
|
||||
<?php echo get_the_title($pinned_post->ID); ?>
|
||||
</p>
|
||||
<p class="hero-banner__text text-13">
|
||||
<?php echo get_the_excerpt($pinned_post->ID); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="tag hero-banner__tag"><?php echo esc_html(get_category_name($pinned_post)); ?></div>
|
||||
</a>
|
||||
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user