需要链接到分页的最后一页

时间:2013-10-07 14:43:39

标签: wordpress wordpress-theming

所以即时使用常规分页

previous_posts_link('<');  // using previous icon like this couse of easyer styling
echo paginate_links( $args ) ;
global $wp_query;
$big = 999999999;
echo paginate_links( array(
    'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    'format' => '?paged=%#%',
    'current' => max( 1, get_query_var('paged') ),
    'total' => $wp_query->max_num_pages,
    'prev_text'    => __(''),
    'next_text'    => __(''),
    'mid_size'     => 2
) );
next_posts_link('>');     // using next icon like this couse of easyer styling

所以我的分页看起来像这样,它有下一个和上一个图标和页码:

  

&LT; 1 2 3&gt;

我还需要有可能进入第一页和最后一页分页这两个图标

  

&LT;&LT;和&gt;&gt;

所以我想出了如何进入分页的第一页,因为它在我的索引页面上我只想链接这两个图标:&lt;&lt;有了这个:

bloginfo('wpurl');

所以我的问题是如何进入分页的最后一页?我的分页看起来应该是这样的:

  

&LT;&LT; &LT; 1 2 3> &GT;&GT;

1 个答案:

答案 0 :(得分:-1)

有一个预建的wordpress函数,可以调用下一页和最后一页链接