Pagination without plugin

Tento článek (nebo jeho část) je převzat z externího zdroje. Je tedy slušností jej uvést včetně případného autora.

This snippet creates a classic paging navigation like the one seen in WP-PageNavi, which give a better overview for the user. It’s easy to implement and gives you total control over the output. I’ll give you an example of how it can look:

To implement it, just add this code to functions.php:

Now you can add the pagination using the pagination(). function. Add it somewhere outside the loop, but inside the if( have_post() ) statement.

WordPress also gives you some CSS classes you can use to customize the look of the new navigation. See the example and you’ll figure out how to style it:

CODE SNIPPET: