Adding pagination with a plugin means bloating your website with unnecessary plugins, just to add something that WordPress has a built-in function for. I’ll show you how to easily add pagination using the built-in WordPress function paginate_links
.
function wcr_pagination(){ global $wp_query; $pagination = array( 'base' => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))), 'format' => '?page=%#%', 'current' => max( 1, get_query_var( 'paged' ) ), 'total' => $wp_query->max_num_pages, 'prev_text' => '«', 'next_text' => '»', 'type' => 'list' ); return paginate_links($pagination); }
This is the output generated by the above code: