Нет описания

pagination.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. if ( ! defined( 'ABSPATH' ) ) {
  18. exit;
  19. }
  20. $total = isset( $total ) ? $total : wc_get_loop_prop( 'total_pages' );
  21. $current = isset( $current ) ? $current : wc_get_loop_prop( 'current_page' );
  22. $base = isset( $base ) ? $base : esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) );
  23. $format = isset( $format ) ? $format : '';
  24. if ( $total <= 1 ) {
  25. return;
  26. }
  27. ?>
  28. <nav class="woocommerce-pagination">
  29. <?php
  30. echo paginate_links(
  31. apply_filters(
  32. 'woocommerce_pagination_args',
  33. array( // WPCS: XSS ok.
  34. 'base' => $base,
  35. 'format' => $format,
  36. 'add_args' => false,
  37. 'current' => max( 1, $current ),
  38. 'total' => $total,
  39. 'prev_text' => is_rtl() ? '&rarr;' : '&larr;',
  40. 'next_text' => is_rtl() ? '&larr;' : '&rarr;',
  41. 'type' => 'list',
  42. 'end_size' => 3,
  43. 'mid_size' => 3,
  44. )
  45. )
  46. );
  47. ?>
  48. </nav>