| Conditions | 4 |
| Paths | 8 |
| Total Lines | 30 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 3 | function podium_pagination() |
||
| 4 | { |
||
| 5 | global $wp_query; |
||
| 6 | |||
| 7 | $next_arrow = is_rtl() ? '<i title="Next Posts" class="fas fa-chevron-left"></i>' : '<i title="Next Posts" class="fas fa-chevron-right"></i>'; |
||
| 8 | $prev_arrow = is_rtl() ? '<i title="Previous Posts" class="fas fa-chevron-right"></i>' : '<i title="Previous Posts" class="fas fa-chevron-left"></i>'; |
||
| 9 | |||
| 10 | $total = $wp_query->max_num_pages; |
||
| 11 | |||
| 12 | $big = 999999999; // This neeFds to be an unlikely integer |
||
| 13 | |||
| 14 | // For more options and info view the docs for paginate_links() |
||
| 15 | // http://codex.wordpress.org/Function_Reference/paginate_links |
||
| 16 | $paginate_links = paginate_links([ |
||
| 17 | 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
||
| 18 | 'current' => max(1, get_query_var('paged')), |
||
| 19 | 'total' => $total, |
||
| 20 | 'show_all' => false, |
||
| 21 | 'prev_text' => $prev_arrow, |
||
| 22 | 'next_text' => $next_arrow, |
||
| 23 | 'type' => 'list' |
||
| 24 | ]); |
||
| 25 | |||
| 26 | // Display the pagination if more than one page is found |
||
| 27 | if ($paginate_links) { |
||
| 28 | echo '<div class="pagination">'; |
||
| 29 | echo $paginate_links; |
||
| 30 | echo '</div>'; |
||
| 31 | } |
||
| 32 | } |
||
| 33 |