我是WordPress的初學者,開始學習它。我正在從現有的父主題設計新的兒童主題。主頁的父在WordPress中更改默認分頁樣式
« Previous 1 2 3 Next »
分頁但我想修改它是這樣的:
Page 1 of 45 1 2 3 NEXT 10 20 30 LAST
以下是我的代碼:
if (!is_singular()) {
global $wp_query, $rtp_post_comments;
if (isset($rtp_post_comments['pagination_show']) && $rtp_post_comments['pagination_show']) {
if (($wp_query->max_num_pages > 1)) {
?>
<nav class="wp-pagenavi"><?php
echo "<span class='page-count'>Page 1 of " . $wp_query->max_num_pages . "</span>";
echo paginate_links(array(
'base' => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))),
'format' => '?paged=%#%',
'current' => max(1, get_query_var('paged')),
'total' => $wp_query->max_num_pages,
'prev_text' => esc_attr($rtp_post_comments['prev_text']),
'next_text' => esc_attr($rtp_post_comments['next_text']),
'end_size' => $rtp_post_comments['end_size'],
'mid_size' => $rtp_post_comments['mid_size']
));
?>
</nav><?php
}
} elseif (function_exists('wp_pagenavi')) {
wp_pagenavi();
} elseif (get_next_posts_link() || get_previous_posts_link()) {
?>
<nav class="navigation clearfix">
<?php if (get_next_posts_link()) { ?><div class="alignleft"><?php next_posts_link(__('Older Entries')); ?></div><?php } ?>
<?php if (get_previous_posts_link()) { ?><div class="alignright"><?php previous_posts_link(__('Newer Entries')); ?></div><?php } ?>
</nav><?php
}
}
我應該在哪裏改變呢?
看起來非常複雜,也許這更容易使用: 1 2 3 10 20 30 NEXT LAST' – user2019515 2013-03-09 11:13:14
@ user2019515:我修改了代碼。 Plz檢查它 – Sky 2013-03-18 10:25:19