Вставить на глвную 
///
<?php
/* ==========================================================
   Последние 5 блогов для главной
   ========================================================== */

// Подключаем функции блога (если ещё не подключено)
if (is_file(__DIR__ . '/includes/blog.php')) {
    require_once __DIR__ . '/includes/blog.php';
} elseif (is_file(__DIR__ . '/../includes/blog.php')) {
    require_once __DIR__ . '/../includes/blog.php';
}

$blogLatest = [];
try {
    if (function_exists('blog_latest')) {
        $blogLatest = blog_latest(5);
    } else {
        // Fallback — если функции нет, делаем запрос напрямую
        $stmt = Database::pdo()->prepare("
            SELECT b.id, b.title, b.description, b.content, b.created_at, b.views,
                   u.login AS author_login
            FROM blog_posts b
            LEFT JOIN users u ON u.id = b.author_id
            WHERE b.is_published = 1
            ORDER BY b.created_at DESC
            LIMIT 5
        ");
        $stmt->execute();
        $blogLatest = $stmt->fetchAll();
    }
} catch (Throwable $e) {
    $blogLatest = [];
}
?>

<?php if (!empty($blogLatest)): ?>
<section class="block" style="margin-top:24px">
    <div class="forum-home-head">
        <h2>
            <span class="material-symbols-rounded" style="font-size:28px">article</span>
            Блог
        </h2>
        <a href="/blog" class="btn btn--accent btn--sm">
            Все посты
            <span class="material-symbols-rounded">arrow_forward</span>
        </a>
    </div>

    <div class="forum-sections">
        <?php foreach ($blogLatest as $bp): ?>
            <a href="/blog/post/<?= (int)$bp['id'] ?>" class="forum-section">
                <span class="material-symbols-rounded forum-section-icon">article</span>

                <div class="forum-section-main">
                    <div class="forum-section-title"><?= e($bp['title']) ?></div>

                    <div class="forum-section-desc">
                        <?= e($bp['description'] ?: excerpt((string)$bp['content'], 140)) ?>
                    </div>

                    <div class="forum-section-meta">
                        Автор: <b><?= e($bp['author_login'] ?? '—') ?></b>
                        · <?= e(format_date($bp['created_at'])) ?>
                        · <span class="material-symbols-rounded" style="font-size:14px">visibility</span>
                        <?= (int)$bp['views'] ?>
                    </div>
                </div>

                <span class="material-symbols-rounded admin-menu-arrow">arrow_forward</span>
            </a>
        <?php endforeach; ?>
    </div>
</section>
<?php endif; ?>