FEATURE Reversing the order of previous / next posts
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nonimart 2025-09-01 13:56:07 +02:00
parent 314654ecf9
commit b53c1b36a0
4 changed files with 71 additions and 14 deletions

View File

@ -6,4 +6,42 @@
.link-title {
@apply font-bold;
}
&__previous {
@apply text-right;
&:before {
@apply inline-block h-7 w-7 border-2 border-neutral-900 rounded-full shrink-0 mr-auto;
content: '';
margin-top: auto;
margin-bottom: auto;
background-image: url('../resources/img/graphic-assets/chevron_left.svg');
background-repeat: no-repeat;
background-position: center;
background-size: 50% 50%;
}
&:after {
@apply content-none;
}
&:only-child {
grid-column: 2;
}
}
&__next {
@apply text-left;
&:after {
@apply inline-block h-7 w-7 border-2 border-neutral-900 rounded-full shrink-0 ml-auto;
content: '';
margin-top: auto;
margin-bottom: auto;
background-image: url('../resources/img/graphic-assets/chevron_right.svg');
background-repeat: no-repeat;
background-position: center;
background-size: 50% 50%;
}
&:before {
@apply content-none;
}
&:only-child {
grid-column: 2;
}
}
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 28.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 7.9 11.7" style="enable-background:new 0 0 7.9 11.7;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
</style>
<path id="Tracé_3614" class="st0" d="M6.7,1.6L1.2,6.1l5.5,4.4"/>
</svg>

After

Width:  |  Height:  |  Size: 549 B

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 28.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 7.9 11.7" style="enable-background:new 0 0 7.9 11.7;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
</style>
<path id="Tracé_3614" class="st0" d="M1.2,10.5L6.7,6L1.2,1.6"/>
</svg>

After

Width:  |  Height:  |  Size: 548 B

View File

@ -213,20 +213,6 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
$prevPost = get_previous_post();
$nextPost = get_next_post();
?>
<?php if ($nextPost) : ?>
<?php $nextPostcover = get_the_post_thumbnail_url($nextPost->ID, 'full'); ?>
<a class="previous-next-posts__next previous-next-artisans__next" href="<?php echo get_the_permalink($nextPost->ID) ?>">
<div class="previous-next-posts__link-content previous-next-artisan__link-content">
<p class="link-subtitle"><?php echo __("Entreprise suivante ", "metiers-patrimoine-theme") ?></p>
<p class="link-title"><?php echo $nextPost->post_title ?></p>
</div>
<?php if ($nextPostcover): ?>
<img class="previous-next-posts__post-thumbnail" src="<?php echo $nextPostcover ?>" alt="">
<?php endif; ?>
</a>
<?php endif; ?>
<?php if ($prevPost) : ?>
<?php $prevPostcover = get_the_post_thumbnail_url($prevPost->ID, 'full'); ?>
<a class="previous-next-posts__previous previous-next-artisan__previous" href="<?php echo get_the_permalink($prevPost->ID) ?>">
@ -239,6 +225,21 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
</div>
</a>
<?php endif; ?>
<?php if ($nextPost) : ?>
<?php $nextPostcover = get_the_post_thumbnail_url($nextPost->ID, 'full'); ?>
<a class="previous-next-posts__next previous-next-artisan__next" href="<?php echo get_the_permalink($nextPost->ID) ?>">
<div class="previous-next-posts__link-content previous-next-artisan__link-content">
<p class="link-subtitle"><?php echo __("Entreprise suivante ", "metiers-patrimoine-theme") ?></p>
<p class="link-title"><?php echo $nextPost->post_title ?></p>
</div>
<?php if ($nextPostcover): ?>
<img class="previous-next-posts__post-thumbnail" src="<?php echo $nextPostcover ?>" alt="">
<?php endif; ?>
</a>
<?php endif; ?>
</div>