fix(user-home): span the tab pagination skeleton across the post grid
The posts/favorites tabs turn the article list into a 2-column grid at >=992px. The AJAX pagination skeleton .post_ajax_loader is a direct child of that grid, so with no grid-column it was laid out as a single half-width card and the whole placeholder stack collapsed into one column while paging or switching tabs. Span the loader across every column and, while loading, give it the same 2-column template the real cards use so placeholders line up with them. The skeleton shape now follows the resolved render mode instead of a hardcoded 'list', so card mode no longer renders list blocks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,9 +35,10 @@ if (!empty($favorite_post_ids)) :
|
||||
'update_post_meta_cache' => false,
|
||||
]);
|
||||
// 面板 AJAX 翻页期间由 author.js 切 .is-loading,骨架沿用文章列表的
|
||||
// .post_ajax_loader 契约。
|
||||
// .post_ajax_loader 契约。形状跟随同一份渲染配置(list / card):
|
||||
// 卡片模式下若仍渲染列表块,骨架就与真实卡片不同轴。
|
||||
$user_home_panel_loader = function_exists('aksrt_render_placeholder')
|
||||
? '<div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'aksrt') . '">' . aksrt_render_placeholder('list', max(4, (int) $per_page)) . '</div>'
|
||||
? '<div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'aksrt') . '">' . aksrt_render_placeholder((string) ($user_home_render_config['mode'] ?? 'list'), max(4, (int) $per_page)) . '</div>'
|
||||
: '';
|
||||
aksrt_render_post_list(array_merge($user_home_render_config, ['wrapper_class' => 'aksrt-user-home__post-list', 'append_inner_html' => $user_home_panel_loader]), $favorites_query);
|
||||
aksrt_render_user_home_pagination((int) $favorites_query->max_num_pages, (int) $favorites_page);
|
||||
|
||||
@@ -30,9 +30,10 @@ $author_posts = new WP_Query([
|
||||
'no_found_rows' => false,
|
||||
]);
|
||||
// 面板 AJAX 翻页期间由 author.js 切 .is-loading,骨架沿用文章列表的
|
||||
// .post_ajax_loader 契约。
|
||||
// .post_ajax_loader 契约。形状跟随同一份渲染配置(list / card):
|
||||
// 卡片模式下若仍渲染列表块,骨架就与真实卡片不同轴。
|
||||
$user_home_panel_loader = function_exists('aksrt_render_placeholder')
|
||||
? '<div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'aksrt') . '">' . aksrt_render_placeholder('list', max(4, (int) $per_page)) . '</div>'
|
||||
? '<div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'aksrt') . '">' . aksrt_render_placeholder((string) ($user_home_render_config['mode'] ?? 'list'), max(4, (int) $per_page)) . '</div>'
|
||||
: '';
|
||||
aksrt_render_post_list(array_merge($user_home_render_config, ['wrapper_class' => 'aksrt-user-home__post-list', 'append_inner_html' => $user_home_panel_loader]), $author_posts);
|
||||
aksrt_render_user_home_pagination((int) $author_posts->max_num_pages, (int) $posts_page);
|
||||
|
||||
Reference in New Issue
Block a user