Currently having slight issues with WP pagination. I've developed a custom theme which requires paging. The paging query is below:
<?php if ($query->max_num_pages > 1) : // custom pagination ?>
<?php
echo paginate_links(array(
'format' => 'page/%#%',
'current' => max(1, get_query_var('page')),
'total' => $query->max_num_pages,
'prev_text' => __('«'),
'next_text' => __('»'),
'mid_size' => 3
));
?>
Now the paging actually works perfectly if I leave it to the default URL structure of ?page=$page_num
however as you can see from the above we are attempting to utilize a slightly prettier URL structure which should have paging set out like /page/$page_num
. I have attempted the following .htaccess
rewrite however I am still returned a 404 page when navigating to /page/$page_num
yet ?page=$page_num
still works fine.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^page/([^/]*)/$ /blog/?page=$1 [L,R=301]
</IfModule>
# END WordPress
I am at a total loss of the next steps to take. Any help would be greatly appreciated.