最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

navigation - Pagination doesn't work in query post in tag template

programmeradmin1浏览0评论

In tag template I use the following query post:

                global $query_string; // required
                $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
                $posts =                    query_posts($query_string.'&posts_per_page=5&cat=-93&paged=' . $paged);  

                if ( have_posts() ) :

                    /* Start the Loop */
                    while ( have_posts() ) : the_post();

                (content)
                endwhile;
                endif;
                wp_reset_query(); // reset the query 

                the_posts_pagination( array( 'prev_text' => 'prev', 'next_text' => 'next' ) );

This is to have the post from current tag but exclude one category and show 5 post per page. But this query post the navigation doesn't work.

I added also the string for 'paged' but nothing changes.

发布评论

评论列表(0)

  1. 暂无评论