Sorry, if I sound a bit naive..
I am a decent PHP developer and have been trying to learn wordpress recently.
Can anyone tell me or point to a tutorial that tells me the best way to show posts on a custom template with pagination ?
Sorry, if I sound a bit naive.. I am a decent PHP developer and
Share
Since occasionally(or maybe most of the time, I’m not sure) you can get permalink conflicts and therefore unexpected 404 pages if you just make a custom
query_posts()and then you add a pagination, with links topage-slug/page/2,page-slug/page/3,page-slug/page/n, I usually set the pagination as a$_GETparameter.Here is an example code for that:
This will create a custom Page template, called
Custom Loop Templateand will display the latest posts, 1 per page. It will have a basic pagination at the bottom starting from 1 to the maximum number of pages for that query.Of course, that’s just a pretty basic example, but it should be enough for you to figure the rest out.