add new main news in mobail

This commit is contained in:
2024-04-03 22:24:30 +03:00
parent 0342a40bb0
commit 83eaa7246b
7 changed files with 62 additions and 4 deletions

View File

@@ -1,6 +1,15 @@
<?php
// Получаем объект закрепленного поста из ACF поля 'pinned_post'
$pinned_post = get_field('pinned_post', 'options');
//$pinned_post = get_field('pinned_post', 'options');
$sticky_posts = get_option('sticky_posts');
// Получаем последний идентификатор прилепленного поста
$last_sticky_post_id = end($sticky_posts);
// Получаем объект поста по его идентификатору
$pinned_post = get_post($last_sticky_post_id);
if ($pinned_post) :
?>