Get next and prev item from custom WP_Query and Custom Post Type
Are you maybe looking for something like this? /** * Outputs blog / archive pagination * */ function my_pagination(){ global $wp_query; $total_pages = $wp_query->max_num_pages; if ($total_pages > 1): $current_page = max(1, get_query_var(‘paged’)); echo paginate_links(array( ‘current’ => $current_page, ‘total’ => $total_pages, ‘prev_text’ => ‘Prev’, ‘next_text’ => ‘Next’, ‘type’ => ‘list’ )); endif; } Then include it … Read more