From b53c1b36a01b35fece4d52bca8a70d26779c044c Mon Sep 17 00:00:00 2001 From: Nonimart Date: Mon, 1 Sep 2025 13:56:07 +0200 Subject: [PATCH] FEATURE Reversing the order of previous / next posts --- .../css/components/previous-next-posts.css | 38 +++++++++++++++++++ resources/img/graphic-assets/chevron_left.svg | 9 +++++ .../img/graphic-assets/chevron_right.svg | 9 +++++ single-artisans.php | 29 +++++++------- 4 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 resources/img/graphic-assets/chevron_left.svg create mode 100644 resources/img/graphic-assets/chevron_right.svg diff --git a/resources/css/components/previous-next-posts.css b/resources/css/components/previous-next-posts.css index 4881f01..1b029e4 100644 --- a/resources/css/components/previous-next-posts.css +++ b/resources/css/components/previous-next-posts.css @@ -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; + } + } } diff --git a/resources/img/graphic-assets/chevron_left.svg b/resources/img/graphic-assets/chevron_left.svg new file mode 100644 index 0000000..d42b276 --- /dev/null +++ b/resources/img/graphic-assets/chevron_left.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/resources/img/graphic-assets/chevron_right.svg b/resources/img/graphic-assets/chevron_right.svg new file mode 100644 index 0000000..a82ee51 --- /dev/null +++ b/resources/img/graphic-assets/chevron_right.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/single-artisans.php b/single-artisans.php index 3f7bc01..cc0a469 100644 --- a/single-artisans.php +++ b/single-artisans.php @@ -213,20 +213,6 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null; $prevPost = get_previous_post(); $nextPost = get_next_post(); ?> - - ID, 'full'); ?> - - - - - - - - - ID, 'full'); ?> @@ -239,6 +225,21 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null; + + ID, 'full'); ?> + + + + + + + + + +