This has been accomplished generally speaking.
the thread you want to read up on is actually called “vBulletin Style Page Navigation,” but i can’t seem to find it anymore either. That doesn’t mean it’s not here, it just means i am too stupid to successfully use a search feature (sorry.)
so i’ll reproduce the essential contents here:
/* WordPress 1.0 vBulletin Style Page Navigation
*
* Last Updated On 28th Marchy 2004
* Based On WP 1.1 Beta
*
* Usage:
* - Options > Other Options > Set what_to_show to Post Paged
* - Copy the below function and paste it in my-hacks.php
* - Edit your index.php file and place <?=page_navigation()?> to where you want it to be displayed.
*/
function page_navigation($before='', $after='', $prelabel='?? ', $nxtlabel=' ??') {
global $p, $what_to_show, $request, $posts_per_page, $wpdb;
global $HTTP_SERVER_VARS, $paged;
global $querystring_start, $querystring_equal, $querystring_separator;
if (empty($p) && ($what_to_show == 'paged')) {
$nxt_request = $request;
$whichpage = $_GET['paged'];
if(empty($whichpage)) $whichpage = 1;
$qstr = $HTTP_SERVER_VARS['QUERY_STRING'];
if (!empty($qstr)) {
$qstr = preg_replace("/&paged=\d{0,}/","",$qstr);
$qstr = preg_replace("/paged=\d{0,}/","",$qstr);
} elseif (stristr($HTTP_SERVER_VARS['REQUEST_URI'], $HTTP_SERVER_VARS['SCRIPT_NAME'] )) {
if ('' != $qstr = str_replace($HTTP_SERVER_VARS['SCRIPT_NAME'], '', $HTTP_SERVER_VARS['REQUEST_URI']) ) {
$qstr = preg_replace("/^\//", "", $qstr);
$qstr = preg_replace("/paged\/\d{0,}\//", "", $qstr);
$qstr = preg_replace("/paged\/\d{0,}/", "", $qstr);
$qstr = preg_replace("/\/$/", "", $qstr);
}
}
if ($pos = strpos(strtoupper($request), 'LIMIT')) {
$nxt_request = substr($request, 0, $pos);
}
$nxt_result = $wpdb->query($nxt_request);
$numposts = $wpdb->num_rows;
$max_page = ceil($numposts / $posts_per_page) ;
echo $before.'Pages ('.$max_page.') : <b>';
if ($whichpage >= 4)
echo '?? First ... ';
previous_posts_link($prelabel);
for($i = $whichpage - 2 ; $i <= $whichpage +2; $i++) {
if ($i >= 1 && $i <= $max_page) {
if($i == $whichpage)
echo '['.$i.'] ';
else
echo ''.$i.' ';
}
}
next_posts_link($nxtlabel, $max_page);
if (($whichpage+2) < ($max_page))
echo ' ... Last ??';
echo '</b>'.$after;
}
}
Now what i don’t know how to accomplish is what you are suggesting:
add this pagination when a Category is selected and there are more posts within it than the page minimum posts shown can display (after a while with a blog, this would most likely be all categories, right?)
how to address that without also adding this to the index.php i don’t know, but would really like to know.
anyone?
dss