bludit/bl-themes/blogx/php/home.php

59 lines
1.7 KiB
PHP
Raw Normal View History

2018-02-01 00:34:16 +01:00
<?php foreach ($content as $page): ?>
<!-- Post -->
2018-02-01 22:43:46 +01:00
<div class="card my-5 border-0">
2018-02-01 00:34:16 +01:00
<!-- Cover image -->
<?php if ($page->coverImage()): ?>
2018-02-01 22:43:46 +01:00
<img class="card-img-top mb-3 rounded-0" alt="Cover Image" src="<?php echo $page->coverImage(); ?>"/>
2018-02-01 00:34:16 +01:00
<?php endif ?>
<div class="card-body p-0">
<!-- Title -->
2018-02-01 22:43:46 +01:00
<a class="text-dark" href="<?php echo $page->permalink(); ?>">
<h2><?php echo $page->title(); ?></h2>
2018-02-01 00:34:16 +01:00
</a>
<!-- Creation date -->
2018-02-17 11:32:05 +01:00
<h6 class="card-subtitle mb-2 text-muted"><?php echo $page->date(); ?> - <?php echo $Language->get('Reading time') . ': ' . $page->readingTime(); ?></h6>
2018-02-01 00:34:16 +01:00
<!-- Breaked content -->
2018-02-01 22:43:46 +01:00
<?php echo $page->contentBreak(); ?>
2018-02-01 00:34:16 +01:00
<!-- "Read more" button -->
<?php if ($page->readMore()): ?>
2018-02-01 22:43:46 +01:00
<a href="<?php echo $page->permalink(); ?>">Read more</a>
2018-02-01 00:34:16 +01:00
<?php endif ?>
</div>
</div>
<hr>
<?php endforeach ?>
<!-- Pagination -->
<?php if (Paginator::amountOfPages()>1): ?>
<nav class="my-4" aria-label="Page navigation">
<ul class="pagination justify-content-center">
<!-- Previuos button -->
<li class="page-item <?php if (Paginator::showNext()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::prevPageUrl() ?>" tabindex="-1">Previous</a>
</li>
<!-- List of pages -->
<?php for ($i = 1; $i <= Paginator::amountOfPages(); $i++): ?>
<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>
</li>
<?php endfor ?>
<!-- Next button -->
<li class="page-item <?php if (Paginator::showPrev()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>">Next</a>
</li>
</ul>
</nav>
<?php endif ?>