| 1 |
<?php if ( 'yes' === $enablePagination && ! is_singular( 'post' ) && isset( $query_result ) && intval( $query_result->max_num_pages ) > 1 ) { ?> |
| 2 |
<div class="qodef-m-pagination qodef--standard"> |
| 3 |
<nav class="navigation pagination" role="navigation" aria-label="<?php esc_attr_e( 'Posts', 'qi-blocks' ); ?>"> |
| 4 |
<h2 class="screen-reader-text"><?php esc_html_e( 'Posts navigation', 'qi-blocks' ); ?></h2> |
| 5 |
<div class="nav-links"> |
| 6 |
<?php |
| 7 |
$prev_text = qi_blocks_get_template_part( 'pagination', 'templates/parts/arrow-left', '', $params ); |
| 8 |
$next_text = qi_blocks_get_template_part( 'pagination', 'templates/parts/arrow-right', '', $params ); |
| 9 |
$current = is_front_page() ? max( 1, get_query_var( 'page' ) ) : max( 1, get_query_var( 'paged' ) ); |
| 10 |
|
| 11 |
echo paginate_links( |
| 12 |
array( |
| 13 |
'prev_text' => $prev_text, |
| 14 |
'next_text' => $next_text, |
| 15 |
'current' => $current, |
| 16 |
'total' => $query_result->max_num_pages, |
| 17 |
) |
| 18 |
); |
| 19 |
?> |
| 20 |
</div> |
| 21 |
</nav> |
| 22 |
</div> |
| 23 |
<?php } ?> |
| 24 |
|