| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying pagination of course within the loop. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/learnpress/loop/course/pagination.php. |
| 6 |
* |
| 7 |
* @author ThimPress |
| 8 |
* @package Learnpress/Templates |
| 9 |
* @version 4.1.1 |
| 10 |
*/ |
| 11 |
|
| 12 |
defined( 'ABSPATH' ) || exit(); |
| 13 |
|
| 14 |
global $wp_query; |
| 15 |
|
| 16 |
$total = $total ?? $wp_query->max_num_pages; |
| 17 |
$paged = $paged ?? get_query_var( 'paged' ); |
| 18 |
$base = $base ?? esc_url_raw( str_replace( 999999999, '%#%', get_pagenum_link( 999999999, false ) ) ); |
| 19 |
|
| 20 |
if ( $total <= 1 ) { |
| 21 |
return; |
| 22 |
} |
| 23 |
?> |
| 24 |
|
| 25 |
<nav class="learn-press-pagination navigation pagination"> |
| 26 |
<?php |
| 27 |
echo paginate_links( |
| 28 |
apply_filters( |
| 29 |
'learn_press_pagination_args', |
| 30 |
array( |
| 31 |
'base' => $base, |
| 32 |
'format' => '', |
| 33 |
'add_args' => '', |
| 34 |
'current' => max( 1, $paged ), |
| 35 |
'total' => $total, |
| 36 |
'prev_text' => '<i class="lp-icon-arrow-left"></i>', |
| 37 |
'next_text' => '<i class="lp-icon-arrow-right"></i>', |
| 38 |
'type' => 'list', |
| 39 |
'end_size' => 3, |
| 40 |
'mid_size' => 3, |
| 41 |
) |
| 42 |
) |
| 43 |
); |
| 44 |
?> |
| 45 |
</nav> |
| 46 |
|