是的,可以显示数字分页。请尝试以下更新的代码:
function wpc_shortcode_title( $atts ) {
extract( shortcode_atts( array( \'limit\' => 5, \'type\' => \'post\'), $atts ) );
$paged = get_query_var(\'paged\') ? get_query_var(\'paged\') : 1;
query_posts( array (
\'posts_per_page\' => $limit,
\'post_type\' => $type,
\'order\' => \'ASC\',
\'orderby\' =>\'menu_order\',
\'paged\' => $paged ) );
$list = \' \';
while ( have_posts() ) { the_post();
$list .= \'<article class="listing-view clearfix">\'
. \'<div class="listing-content">\'
. \'<h3><a href="\' . get_permalink() . \'">\' . get_the_title() . \'</a></h3>\'
.\'<p>\' . get_the_excerpt() . \'</p>\'
. \'<a href="\' . get_permalink() . \'">\' . \'View »\' . \'</a>\'
. \'</div>\'
. \'<a class="listing-thumb" href="\' . get_permalink() . \'">\' . get_the_post_thumbnail($page->ID, \'listing-thumb\') . \'<span></span></a>\'
. \'</article>\';
}
global $wp_query;
$args_pagination = array(
\'base\' => add_query_arg( \'paged\', \'%#%\' ),
\'total\' => $wp_query->max_num_pages,
\'current\' => $paged
);
$list .= \'<div class="post-nav">\';
$list .= paginate_links( $args_pagination);
$list .= \'</div>\';
return
\'<div class="listings clearfix">\'
. $list
. \'</div>\' .
wp_reset_query();
}
add_shortcode( \'title-snippet\', \'wpc_shortcode_title\' );