Following a Wordpress Pagination tutorial, wp_logout_url( get_permalink() );
no longer redirects to the correct page. Instead of redirecting to say domain.com/page/2/
, it redirects me to one of the posts in the listed category.
Is there a way to fix this?
global $wp_query;
$total_pages = $wp_query->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, get_query_var('paged'));
echo '<div class="page_nav">';
echo paginate_links(array(
'base' => get_pagenum_link(1) . '%_%',
'format' => 'page/%#%',
'current' => $current_page,
'total' => $total_pages,
'prev_text' => 'Prev',
'next_text' => 'Next'
));
echo '</div>';
}