My Wordpress pagination works but I'd like to make some 'minor' adjustments. I thought I'd be able to find some code I could drop into my functions.php but I can't find anything that does the job, so I'm hoping for a bit of help.
Basically I want the pagination to always display the prev/next arrows, whichever one isn't needed has a class of inactive for styling - currently whichever isn't required isn't displayed at all. Also, I'd like to know if '...' is added between a range of pages if they exceed a certain amount to prevent the list from getting too long?
Here's the current code I have in functions.php:
function html5wp_pagination()
{
global $wp_query;
$big = 999999999;
echo paginate_links(array(
'base' => str_replace($big, '%#%', get_pagenum_link($big)),
'format' => '?paged=%#%',
'current' => max(1, get_query_var('paged')),
'total' => $wp_query->max_num_pages
));
}
Hope someone can help. I'm getting there with Wordpress/PHP development but somethings still look totally foreign to me!
Update Your pagination code like below:
echo paginate_links(array(
'base' => str_replace($big, '%#%', get_pagenum_link($big)),
'format' => '?paged=%#%',
'current' => max(1, get_query_var('paged')),
'total' => $wp_query->max_num_pages,
'show_all' => False,
'prev_next' => True,
'prev_text' => __('<'),
'next_text' => __('>'),
'type' => 'list',
'add_args' => ''
));