We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f755dd2 commit 85fc517Copy full SHA for 85fc517
Block/Post/View/NextPrev.php
@@ -82,8 +82,10 @@ public function getPrevPost()
82
$collection = $this->_getFrontendCollection()->addFieldToFilter(
83
'publish_time', [
84
'gteq' => $this->getPost()->getPublishTime()
85
- ]
86
- );
+ ])
+ ->setOrder('publish_time', 'ASC')
87
+ ->setPageSize(1);
88
+
89
$post = $collection->getFirstItem();
90
91
if ($post->getId()) {
@@ -105,8 +107,10 @@ public function getNextPost()
105
107
106
108
109
'lteq' => $this->getPost()->getPublishTime()
110
111
+ ->setOrder('publish_time', 'DESC')
112
113
114
115
116
0 commit comments