<?php
/**
* Pagination
*
* @package Bootscore
* @version 6.3.1
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
/**
* Pagination Categories
*/
if (!function_exists('bootscore_pagination')) :
function bootscore_pagination($pages = '', $range = 2) {
$showitems = ($range * 2) + 1;
global $paged;
// default page to one if not provided
if (empty($paged)) $paged = 1;
if ($pages == '') {
global $wp_query;
$pages = $wp_query->max_num_pages;
if (!$pages) {
$pages = 1;
}
}
if (1 != $pages) {
echo '<nav aria-label="Page navigation">';
echo '<span class="visually-hidden">' . esc_html__('Page navigation', 'bootscore') . '</span>';
echo '<ul class="pagination justify-content-center mb-4">';
if ($paged > 2 && $paged > $range + 1 && $showitems < $pages) {
echo '<li class="page-item"><a class="page-link" href="' . esc_url(get_pagenum_link(1)) . '" aria-label="' . esc_attr__('First Page', 'bootscore') . '">«</a></li>';
}
if ($paged > 1 && $showitems < $pages) {
echo '<li class="page-item"><a class="page-link" href="' . esc_url(get_pagenum_link($paged - 1)) . '" aria-label="' . esc_attr__('Previous Page', 'bootscore') . '">‹</a></li>';
}
for ($i = 1; $i <= $pages; $i ++) {
if (1 != $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) {
echo ($paged == $i) ? '<li class="page-item active"><span class="page-link"><span class="visually-hidden">' . esc_html__('Current Page', 'bootscore') . ' </span>' . esc_html($i) . '</span></li>' : '<li class="page-item"><a class="page-link" href="' . esc_url(get_pagenum_link($i)) . '"><span class="visually-hidden">' . esc_html__('Page', 'bootscore') . ' </span>' . esc_html($i) . '</a></li>';
}
}
if ($paged < $pages && $showitems < $pages) {
echo '<li class="page-item"><a class="page-link" href="' . esc_url(get_pagenum_link(($paged === 0 ? 1 : $paged) + 1)) . '" aria-label="' . esc_attr__('Next Page', 'bootscore') . '">›</a></li>';
}
if ($paged < $pages - 1 && $paged + $range - 1 < $pages && $showitems < $pages) {
echo '<li class="page-item"><a class="page-link" href="' . esc_url(get_pagenum_link($pages)) . '" aria-label="' . esc_attr__('Last Page', 'bootscore') . '">»</a></li>';
}
echo '</ul>';
echo '</nav>';
// Uncomment this if you want to show [Page 2 of 30]
// echo '<div class="pagination-info mb-5 text-center">[ <span class="text-body-secondary">' . __('Page', 'bootscore') . '</span> '.$paged.' <span class="text-body-secondary">' . __('of', 'bootscore') . '</span> '.$pages.' ]</div>';
}
}
endif;
/**
* Pagination Single Posts
*/
add_filter('next_post_link', 'post_link_attributes');
add_filter('previous_post_link', 'post_link_attributes');
function post_link_attributes($output) {
$code = 'class="page-link"';
return str_replace('<a href=', '<a ' . $code . ' href=', $output);
}
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| blocks/ | 2026-11-26 08:19 | 19.5 KB | 76129f60960:kunden | dxwrx-rx-r | |
| scssphp/ | 2026-11-26 08:19 | 549.31 KB | 76129f60960:kunden | dxwrx-rx-r | |
| update/ | 2026-11-26 08:19 | 380.49 KB | 76129f60960:kunden | dxwrx-rx-r | |
| updater/ | 2026-11-26 08:19 | 25.44 KB | 76129f60960:kunden | dxwrx-rx-r | |
| breadcrumb.php | 2026-11-26 08:19 | 6.2 KB | 76129f60960:kunden | -xw-x--x-- | |
| columns.php | 2026-11-26 08:19 | 703 B | 76129f60960:kunden | -xw-x--x-- | |
| comments.php | 2026-11-26 08:19 | 5.27 KB | 76129f60960:kunden | -xw-x--x-- | |
| deprecated.php | 2026-11-26 08:19 | 132 B | 76129f60960:kunden | -xw-x--x-- | |
| enable-html.php | 2026-11-26 08:19 | 642 B | 76129f60960:kunden | -xw-x--x-- | |
| enqueue.php | 2026-11-26 08:19 | 3.59 KB | 76129f60960:kunden | -xw-x--x-- | |
| excerpt.php | 2026-11-26 08:19 | 200 B | 76129f60960:kunden | -xw-x--x-- | |
| fontawesome.php | 2026-11-26 08:19 | 1.02 KB | 76129f60960:kunden | -xw-x--x-- | |
| jetpack.php | 2026-11-26 08:19 | 1.47 KB | 76129f60960:kunden | -xw-x--x-- | |
| navmenu.php | 2026-11-26 08:19 | 681 B | 76129f60960:kunden | -xw-x--x-- | |
| navwalker.php | 2026-11-26 08:19 | 6.97 KB | 76129f60960:kunden | -xw-x--x-- | |
| pagination.php | 2026-11-26 08:19 | 3.01 KB | 76129f60960:kunden | -xw-x--x-- | |
| password-protected-form.php | 2026-11-26 08:19 | 864 B | 76129f60960:kunden | -xw-x--x-- | |
| scss-compiler.php | 2026-11-26 08:19 | 7.26 KB | 76129f60960:kunden | -xw-x--x-- | |
| template-functions.php | 2026-11-26 08:19 | 1005 B | 76129f60960:kunden | -xw-x--x-- | |
| template-tags.php | 2026-11-26 08:19 | 8.87 KB | 76129f60960:kunden | -xw-x--x-- | |
| theme-setup.php | 2026-11-26 08:19 | 2.71 KB | 76129f60960:kunden | -xw-x--x-- | |
| tinymce-editor.php | 2026-11-26 08:19 | 841 B | 76129f60960:kunden | -xw-x--x-- | |
| widgets.php | 2026-11-26 08:19 | 5.97 KB | 76129f60960:kunden | -xw-x--x-- | |