feat(frontend): replace article system with Zibll 9.0

This commit is contained in:
kate522 committed 2026-08-18 16:06:47 +08:00
1 parent 2881c69e9c
commit 0f2ac6c34a
69 files changed
+2603 -4163

No files matched your search

+8 -12
View File
@@ -16,11 +16,11 @@ if (!is_array($cfg)) $cfg = [];
$cat_ids = isset($cfg['cat_ids']) && is_array($cfg['cat_ids']) ? array_map('intval', $cfg['cat_ids']) : [];
$cat_ids = array_filter($cat_ids, fn($x) => $x > 0);
$count = max(1, min(20, (int) ($cfg['count'] ?? 8)));
$layout = (string) ($cfg['layout'] ?? 'grid-cms');
$layout = (string) ($cfg['layout'] ?? 'card');
$title = (string) ($cfg['title'] ?? '');
if (!in_array($layout, ['card', 'list', 'masonry', 'grid-cms'], true)) {
$layout = 'grid-cms';
if (!in_array($layout, ['card', 'list'], true)) {
$layout = 'card';
}
if (empty($cat_ids)) {
@@ -86,15 +86,11 @@ $active_id = $tabs[0]['id'];
<?php if ($query->have_posts()) : ?>
<div class="posts-row ajaxpager tab-content">
<?php
set_query_var('aksrt_post_card_layout', $layout === 'list' ? 'list' : 'card');
set_query_var('aksrt_post_card_scene', 'home');
while ($query->have_posts()) {
$query->the_post();
get_template_part('templates/parts/content', 'post-card');
}
set_query_var('aksrt_post_card_layout', '');
set_query_var('aksrt_post_card_scene', '');
wp_reset_postdata();
aksrt_render_post_list([
'type' => $layout === 'card' ? 'card' : 'list',
'is_home' => true,
'skip_wrapper' => true,
], $query);
?>
</div>
<?php else : ?>