开发者

I added a wp-query in front of my loop but it disables any pagination

I'm using the Showtime wordpress开发者_StackOverflow theme which builds a blog based on a single category.

I modified it and added a query_posts('cat='.$category_id.''.$temp.'&posts_per_page='.get_option('posts_per_page')); in front of the loop to get multiple categories back.

However, this query disables pagination and makes every page the same posts.

I guess i would have to modify the orignal wp-query the theme uses? Where is it usually located as I cannot find it?

Thanks


I ended up doing this:

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('cat='.$category_id.''.$temp.'&paged='.$paged.'&posts_per_page='.get_option('posts_per_page')); // choose which category posts are shown


Try adding

wp_reset_query();

After you loop on your query_posts

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜