[CODE]
function kriesi_pagination ($ pages = '', $ range = 2)
{
Showitems $ = ($ range * 2) +1;
global $ paged;
if (empty ($ paged)) $ paged = 1;
if ($ pages == '')
{
global $ WP_Query;
$ Pages = $ wp_query-> max_num_pages;
if (! $ pages)
{
Pages = $ 1;
}
}
if (1! = $ pages)
{
echo "<div class = ' pagination '> ";
if ($ paged> 2 && $ paged> $ range + 1 && $ showitems <$ pages) echo" <a href ='. " get_pagenum_link (1). " '> & Laquo; </a>";
if ($ paged> 1 && $ showitems <$ pages) echo "<a href ='." get_pagenum_link ($ paged - 1). " '> & Lsaquo; </a>";
for ($ i = 1; $ i <= $ pages; $ i ++)
{
if (1! = $ Pages && (! ($ I> = $ paged range + $ + $ 1 || i <= $ $ paged- range-1) || $ pages <= $ showitems))
{
echo ($ paged == $ i)? "<Span class = 'current'>." $ I. "</ span>" "<a href='".get_pagenum_link($i)."' class='inactive'>". $ I. "</ a>";
}
}
if ($ paged <$ pages && $ showitems <$ pages) echo "<a href = '." get_pagenum_link ($ paged + 1). " '> & Rsaquo; </a>";
if ($ paged <$ pages-1 && $ paged + $ -range 1 <$ pages && $ showitems <$ pages) echo "<a href ='." get_pagenum_link ($ pages). " '> & Raquo; </a>";
echo "</ div> \ n";
}
}
[/ CODE]
how to use
[CODE] kriesi_pagination (); [/ CODE]
This is the best example of work That I found.