52dc0b9c5c
Fixes #30 Fixes #35 Fixes #36 Fixes #38 Fixes #40 Fixes #43 Fixes #44 Fixes #46 Fixes #47 Fixes #49 Fixes #51 Fixes #53
43 lines
1.9 KiB
PHP
43 lines
1.9 KiB
PHP
<?php if(have_posts()) : ?>
|
|
<div class="preview-grid">
|
|
<?php while(have_posts()) : the_post(); ?>
|
|
<article class="card card-preview card-primary">
|
|
<a href="<?php the_permalink(); ?>" class="preview-link">
|
|
<h1 class="card-header"><?php the_title(); ?></h1>
|
|
<div class="preview-content">
|
|
<?php if(!has_post_thumbnail( $post->ID )) {
|
|
?>
|
|
<div class="preview-exerpt" aria-hidden="true"><?php the_excerpt(); ?></div>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<div class="preview-exerpt" aria-hidden="true"><p class="p-img"><img class="preview-img" src="<?php echo get_the_post_thumbnail_url(); ?>" /></p></div>
|
|
<?php
|
|
}
|
|
?>
|
|
<div class="preview-overlay">
|
|
<div class="preview-metadata">
|
|
<div class="metadata-pills">
|
|
<div><?php
|
|
if (!has_category('chapters')) {
|
|
$category = get_the_category();
|
|
echo"<span class='btn-small btn-info small-text'>" . $category[0]->cat_name . "</span>";
|
|
} else {
|
|
$romans = get_the_terms($post->ID, 'roman');
|
|
echo"<span class='btn-small btn-info small-text'>" . $romans[0]->name . "</span>";
|
|
}
|
|
?></div>
|
|
<div><time><span class="btn-small btn-info small-text"><?php the_time('d/m/Y') ?></span></time></div>
|
|
</div>
|
|
<div class="comment-text"><?php comments_number('Pas de commentaire', 'Un commentaire', '% commentaires' );?></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</article>
|
|
<?php endwhile; ?>
|
|
</div>
|
|
<div class="navigation">
|
|
<?php the_posts_pagination(); ?>
|
|
</div>
|
|
<?php endif; ?>
|