Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://stackoverflow.com/questions/41738362/how-to-include-pagination-in-a-wordpress-custom-post-type-query
- <?php
- $total_pages = $loop->max_num_pages;
- if ($total_pages > 1){
- $current_page = max(1, get_query_var('paged'));
- echo paginate_links(array(
- 'base' => get_pagenum_link(1) . '%_%',
- 'format' => '/page/%#%',
- 'current' => $current_page,
- 'total' => $total_pages,
- 'prev_text' => __('« prev'),
- 'next_text' => __('next »'),
- ));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement