Fix pagination in blogx and alternative

This commit is contained in:
Anaggh S 2018-03-08 23:43:28 +05:30
parent 1c2bd6497f
commit ed15866770
3 changed files with 24 additions and 26 deletions

View File

@ -45,28 +45,26 @@
<!-- Pagination --> <!-- Pagination -->
<?php if (Paginator::amountOfPages()>1): ?> <?php if (Paginator::amountOfPages()>1): ?>
<div class="paginator"> <nav class="paginator" aria-label="Page navigation">
<nav aria-label="Page navigation"> <ul class="pagination flex-wrap justify-content-center">
<ul class="pagination justify-content-center">
<!-- Previuos button --> <!-- Previous button -->
<li class="page-item <?php if (Paginator::showNext()); echo 'disabled' ?>"> <li class="page-item <?php if (!Paginator::showPrev()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::prevPageUrl(); ?>" tabindex="-1">Previous</a> <a class="page-link" href="<?php echo Paginator::prevPageUrl() ?>" tabindex="-1">Previous</a>
</li> </li>
<!-- List of pages --> <!-- List of pages -->
<?php for ($i = 1; $i <= Paginator::amountOfPages(); $i++): ?> <?php for ($i = 1; $i <= Paginator::amountOfPages(); $i++): ?>
<li class="page-item <?php if ($i==Paginator::currentPage()); echo 'active' ?>"> <li class="page-item <?php if ($i==Paginator::currentPage()) echo 'active' ?>">
<a class="page-link" href="<?php echo Paginator::numberUrl($i); ?>"><?php echo $i ?></a> <a class="page-link" href="<?php echo Paginator::numberUrl($i) ?>"><?php echo $i ?></a>
</li> </li>
<?php endfor ?> <?php endfor ?>
<!-- Next button --> <!-- Next button -->
<li class="page-item <?php if (Paginator::showPrev()); echo 'disabled' ?>"> <li class="page-item <?php if (!Paginator::showNext()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::nextPageUrl(); ?>">Next</a> <a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>">Next</a>
</li> </li>
</ul> </ul>
</nav> </nav>
</div>
<?php endif ?> <?php endif ?>

View File

@ -35,10 +35,10 @@
<!-- Pagination --> <!-- Pagination -->
<?php if (Paginator::amountOfPages()>1): ?> <?php if (Paginator::amountOfPages()>1): ?>
<nav class="my-4" aria-label="Page navigation"> <nav class="my-4" aria-label="Page navigation">
<ul class="pagination"> <ul class="pagination flex-wrap">
<!-- Previuos button --> <!-- Previous button -->
<li class="page-item <?php if (Paginator::showNext()) echo 'disabled' ?>"> <li class="page-item <?php if (!Paginator::showPrev()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::prevPageUrl() ?>" tabindex="-1">Previous</a> <a class="page-link" href="<?php echo Paginator::prevPageUrl() ?>" tabindex="-1">Previous</a>
</li> </li>
@ -50,7 +50,7 @@
<?php endfor ?> <?php endfor ?>
<!-- Next button --> <!-- Next button -->
<li class="page-item <?php if (Paginator::showPrev()) echo 'disabled' ?>"> <li class="page-item <?php if (!Paginator::showNext()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>">Next</a> <a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>">Next</a>
</li> </li>