add-to-cart.php
6 years ago
loop-end.php
6 years ago
loop-start.php
6 years ago
no-products-found.php
6 years ago
orderby.php
6 years ago
pagination.php
6 years ago
price.php
6 years ago
rating.php
7 years ago
result-count.php
6 years ago
sale-flash.php
6 years ago
pagination.php
52 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Pagination - Show numbered pagination for catalog pages |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/loop/pagination.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://docs.woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce/Templates |
| 15 | * @version 3.3.1 |
| 16 | */ |
| 17 | |
| 18 | if ( ! defined( 'ABSPATH' ) ) { |
| 19 | exit; |
| 20 | } |
| 21 | |
| 22 | $total = isset( $total ) ? $total : wc_get_loop_prop( 'total_pages' ); |
| 23 | $current = isset( $current ) ? $current : wc_get_loop_prop( 'current_page' ); |
| 24 | $base = isset( $base ) ? $base : esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) ); |
| 25 | $format = isset( $format ) ? $format : ''; |
| 26 | |
| 27 | if ( $total <= 1 ) { |
| 28 | return; |
| 29 | } |
| 30 | ?> |
| 31 | <nav class="woocommerce-pagination"> |
| 32 | <?php |
| 33 | echo paginate_links( |
| 34 | apply_filters( |
| 35 | 'woocommerce_pagination_args', |
| 36 | array( // WPCS: XSS ok. |
| 37 | 'base' => $base, |
| 38 | 'format' => $format, |
| 39 | 'add_args' => false, |
| 40 | 'current' => max( 1, $current ), |
| 41 | 'total' => $total, |
| 42 | 'prev_text' => '←', |
| 43 | 'next_text' => '→', |
| 44 | 'type' => 'list', |
| 45 | 'end_size' => 3, |
| 46 | 'mid_size' => 3, |
| 47 | ) |
| 48 | ) |
| 49 | ); |
| 50 | ?> |
| 51 | </nav> |
| 52 |