I want to link to an archive page in WordPress, so like:

<a href="<?php page( 2 ); ?>">link</a>

so if a for example a category page is shown, this link needs to go to the second page for that category.

  • use a pagination plugin like this or tthis – Anjum Aug 20 '13 at 19:06

After a long search on the Web, I decided to take a look at the plugins @anjum sent, and found out this can be done through:

<a href="<?php get_pagenum_link($i); ?>">Link to page $i</a>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.