Custom Pagination without WordPress Plugins

On day 9 of our Advents Calendar we show a custom pagination function which allows a user to insert custom next, previous or numbered page links into a post. Use the follow code for an custom plugin or insert the function in your theme, inside the functions.php. Please see the second code-area for an example to hook inside the function for custom parameters.
Continue reading …

Correct Pagination with get_posts

If you like to show your posts a little bit different on your homepage or category page. For example having a different amount of posts showing on these pages, as it is set in your admin, you will get a problem with the pagination function. Because WordPress and several paging Plugins use $wp_query->max_num_pages.
Continue reading …