pagination.php ➔ podium_pagination()   A
last analyzed

Complexity

Conditions 4
Paths 8

Size

Total Lines 30

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
nc 8
nop 0
dl 0
loc 30
rs 9.44
c 0
b 0
f 0
1
<?php
2
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