如果我单击一个随机标记,我希望标记页面只列出20篇与该标记相关的文章并分页。
<?php
/**
* The template for displaying Tag Archive pages.
*/
get_header(); ?>
<div id="container">
<div id="content" role="main">
<h1 class="page-title"><?php
printf( __( \'Tag Archives: %s\', \'twentyten\' ), \'<span>\' . single_tag_title( \'\', false ) . \'</span>\' );
?></h1>
<?php $paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$args = array( \'orderby\' => \'title\', \'order\' => \'ASC\', \'post_type\' => \'post\', \'posts_per_page\' => 20, \'paged\' => $paged );
$wp_query = new WP_Query($args);
while ( have_posts() ) : the_post(); ?>
<div <?php post_class() ?>>
<ul><li id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_post_thumbnail(thumbnail); ?></a></ul>
</div>
<?php endwhile; ?>
<?php if (function_exists("pagination")) {
pagination($additional_loop->max_num_pages);
} ?>
</div><!-- #content -->
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
这段代码的问题是它列出了所有与该标记相关的帖子,而不是帖子。有人能帮我修理吗?