With a lot of search and trial&error, I's unable to do the pagination in a custom page template. I's not actually tired, but frustrated, why the most common err issue is not explained in a way so that somebody can dig into the actual problem. In most of the Q&A, there's a solution with a bulk of code, that's not a bullet-proof solution at all. There are lots of philosophy, but there's no actual digging into the solution.
Eventually I came across to Chris' solution to the pagination of a Custom Post Type. I'm not dealing with CPT, but the solution worked for me.
Where, my Query arguments are:
$wp_query->query('posts_per_page=3&post_type=post&order=DESC&orderby=date&post_status=publish'.'&paged='.$paged);
Except that portion everything is as followed as Chris stated. My pagination is working nicely.
But I'm actually concern about some issues:
- First, what's the code actually doing?
- I think it's now taking more time (performance issue) than the default solution — is that actually right?
- Is that safe messing with the global
$wp_query
?