文章详细页实现全局DOM加载
This commit is contained in:
1 parent
65fbf97099
commit
b161d6e5c8
5 files changed
+267
-97
No files matched your search
@@ -653,7 +653,7 @@ if (!function_exists('aksrt_comments_render')) :
|
||||
? sprintf(__('共%s条', 'aksrt'), (string) $count)
|
||||
: __('抢沙发', 'aksrt');
|
||||
?>
|
||||
<div class="theme-box" id="comments">
|
||||
<div class="theme-box" id="comments" data-post-id="<?php echo esc_attr((string) get_the_ID()); ?>">
|
||||
<div class="box-body notop">
|
||||
<div class="title-theme"><?php echo esc_html((string) $ctx['title_text']); ?>
|
||||
<?php echo '<small>' . esc_html($count_label) . '</small>'; ?>
|
||||
|
||||
@@ -575,9 +575,17 @@ if (!function_exists('aksrt_render_comment_pagination')) {
|
||||
}
|
||||
|
||||
// 数字分页(legacy:paginate_links + 跳页输入框)
|
||||
// 路径式 comment-page-N 链接:地址栏与 href 均不携带 ? 参数(无 JS 时仍可整页翻页)。
|
||||
global $wp_rewrite;
|
||||
if (get_option('permalink_structure') && $wp_rewrite instanceof WP_Rewrite && !empty($wp_rewrite->comments_pagination_base)) {
|
||||
$base = user_trailingslashit(trailingslashit(get_permalink()) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged');
|
||||
} else {
|
||||
// 无伪静态时只能用查询参数(页面地址本身已带 ?p=)。
|
||||
$base = add_query_arg('cpage', '%#%', get_permalink());
|
||||
}
|
||||
$is_mobile = wp_is_mobile();
|
||||
$args = [
|
||||
'base' => add_query_arg('cpage', '%#%', get_permalink()),
|
||||
'base' => $base,
|
||||
'type' => 'array',
|
||||
'mid_size' => $is_mobile ? 1 : 2,
|
||||
'prev_text' => '<i class="fa fa-angle-left em12"></i><span class="hide-sm ml6">' . __('上一页', 'aksrt') . '</span>',
|
||||
@@ -596,7 +604,7 @@ if (!function_exists('aksrt_render_comment_pagination')) {
|
||||
$array[] = '<a class="pag-jump page-numbers" href="javascript:;" no-scroll="true" data-jump-comments="1"><input autocomplete="off" max="' . esc_attr((string) $max_pages) . '" current="' . esc_attr((string) $paged) . '" type="' . ($is_mobile ? 'number' : 'text') . '" class="form-control jump-input" name="pag-go"><span class="hide-sm mr6 jump-text">' . __('跳转', 'aksrt') . '</span><i class="jump-icon fa fa-angle-double-right em12"></i></a>';
|
||||
}
|
||||
|
||||
echo '<div class="pagenav">';
|
||||
echo '<div class="pagenav" data-current-page="' . esc_attr((string) $paged) . '" data-max-pages="' . esc_attr((string) $max_pages) . '">';
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- paginate_links 输出与既定跳页标记。
|
||||
echo implode('', $array);
|
||||
echo '</div>';
|
||||
|
||||
Reference in new issue
Block a user