$mode, 'context' => $context, ]); echo aksrt_render_post($config); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped return; } // ============================================================ // Fallback: self-contained rendering when shared renderer unavailable // ============================================================ $args = isset($args) && is_array($args) ? $args : []; $lazy_cfg = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_lazyload_config() : ['enabled' => false, 'placeholder_url' => '']; $lazy_on = !empty($lazy_cfg['enabled']); $placeholder_url = !empty($lazy_cfg['placeholder_url']) ? (string) $lazy_cfg['placeholder_url'] : (get_template_directory_uri() . '/assets/img/placeholder.svg'); $forced_layout = (string) get_query_var('aksrt_post_card_layout', ''); $layout = 'card'; if (is_string($forced_layout) && in_array($forced_layout, ['card', 'list', 'masonry', 'grid-cms'], true)) { $layout = $forced_layout; } elseif (function_exists('aksrt_get_post_flow') && aksrt_get_post_flow(get_the_ID()) === 'cms') { $layout = 'grid-cms'; } elseif (class_exists('AKSRT_Settings')) { $layout = AKSRT_Settings::get_archive_layout(); } $post_id = get_the_ID(); $author_id = get_the_author_meta('ID'); $author = get_the_author(); $avatar_url = get_avatar_url($author_id, ['size' => 40]); $time_ago = human_time_diff(get_the_time('U'), current_time('timestamp')) . __('前', 'aksrt'); $excerpt = wp_trim_words(get_the_excerpt(), 'list' === $layout ? 30 : 20, '...'); $tags = get_the_tags() ?: []; $categories = get_the_category() ?: []; $comment_count = (int) get_comments_number(); $views = function_exists('aksrt_get_post_views') ? aksrt_get_post_views($post_id) : 0; $is_sticky = is_sticky($post_id); $title_html = isset($args['title_html']) ? (string) $args['title_html'] : get_the_title(); $resource_badge = function_exists('aksrt_resource_card_badge_text') ? aksrt_resource_card_badge_text($post_id) : ''; $img_url = ''; if (has_post_thumbnail()) { $img_url = get_the_post_thumbnail_url($post_id, 'medium_large'); } elseif (function_exists('aksrt_get_first_content_image_url')) { $img_url = (string) aksrt_get_first_content_image_url($post_id); } $has_img = !empty($img_url); $scene = (string) get_query_var('aksrt_post_card_scene', ''); $is_home_scene = $scene === 'home' || is_front_page() || (is_home() && !is_paged()); $category_limit = $is_home_scene ? 1 : 3; $tag_limit = $is_home_scene ? 2 : 3; // Badges HTML ob_start(); ?>
name); ?> # name); ?>
>
<?php echo esc_attr(get_the_title()); ?> <?php echo esc_attr(get_the_title()); ?>

>
<?php echo esc_attr(get_the_title()); ?> <?php echo esc_attr(get_the_title()); ?>