Hi again,
Two quick changes to Jaykul’s code and it’s working for multiple categories and search terms.
To get multiple categories working I had to allow /
symbols in the category
part of the URL in the .htaccess
rewrites, so I changed the first RewriteRule
to read:
RewriteRule ^category/(.*)?page/?([0-9]{1,})?/? /index.php?category_name=$1&paged=$2 [QSA,L]
which works (ie: anything after category
and page
at the end of the URL), and I don’t think causes damage elsewhere.
I also had a problem with search terms having two ampersands in the next page URL, which meant that it failed to go to the correct page. To get it working, simply change one line in the get_pagenum_link
function, shortly after the if stristr
line to:
$qstr .= $querystring_separator.$page_querystring.$querystring_equal.$pagenum;
The $querystring_equal
is declared global above this point but never used, so it’s just a small typo.
HTH,
—
ian.