Skip to content

Instantly share code, notes, and snippets.

@corsonr
corsonr / Create a custom pagination
Created August 8, 2012 07:24
A simple pagination in a few lines of code
<?php
/* ------------------------------------------------------------------*/
/* PAGINATION */
/* ------------------------------------------------------------------*/
//paste this where the pagination must appear
global $wp_query;
$total = $wp_query->max_num_pages;
// only bother with the rest if we have more than 1 page!