From 8109f7d039c243285a0caeee92bbbc2614c4e76c Mon Sep 17 00:00:00 2001 From: Jacek Gajewski <49660272+blift@users.noreply.github.com> Date: Fri, 8 Dec 2023 17:44:28 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Check=20`wp=5Flink=5Fpages?= =?UTF-8?q?`=20before=20rendering=20in=20`content-single.blade.php`=20(#31?= =?UTF-8?q?57)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Brandon --- app/View/Composers/Post.php | 17 ++++++++++++++++- resources/views/partials/content-page.blade.php | 6 +++++- .../views/partials/content-single.blade.php | 10 +++++++--- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/app/View/Composers/Post.php b/app/View/Composers/Post.php index 0d3987918b..5bcef38428 100644 --- a/app/View/Composers/Post.php +++ b/app/View/Composers/Post.php @@ -26,11 +26,12 @@ public function override() { return [ 'title' => $this->title(), + 'pagination' => $this->pagination(), ]; } /** - * Returns the post title. + * Retrieve the post title. * * @return string */ @@ -66,4 +67,18 @@ public function title() return get_the_title(); } + + /** + * Retrieve the pagination links. + * + * @return string + */ + public function pagination() + { + return wp_link_pages([ + 'echo' => 0, + 'before' => '

' . __('Pages:', 'sage'), + 'after' => '

', + ]); + } } diff --git a/resources/views/partials/content-page.blade.php b/resources/views/partials/content-page.blade.php index 5d4d20430d..5d394ebd8d 100644 --- a/resources/views/partials/content-page.blade.php +++ b/resources/views/partials/content-page.blade.php @@ -1,3 +1,7 @@ @php(the_content()) -{!! wp_link_pages(['echo' => 0, 'before' => '']) !!} +@if ($pagination) + +@endif diff --git a/resources/views/partials/content-single.blade.php b/resources/views/partials/content-single.blade.php index 76cce86aba..bb7b8a9aed 100644 --- a/resources/views/partials/content-single.blade.php +++ b/resources/views/partials/content-single.blade.php @@ -11,9 +11,13 @@ @php(the_content()) - + @if ($pagination) + + @endif @php(comments_template())