# 'Next' button on a blog post page

**URL:** <https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251>\
**Category:** Ask the community\
**Tags:** wix-blog, question, code\
**Created:** [August 21, 2019, 10:59am UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251 "2019-08-21T10:59:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![stonecoldcrrrazy](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@stonecoldcrrrazy](https://forum.wixstudio.com/u/stonecoldcrrrazy)\
**Post date:** [August 21, 2019, 10:59am UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/1 "2019-08-21T10:59:56Z")

</div>

Hello,  
I want to put a ‘Next’ button on the bottom of each blog post page, that would take the reader to the next (older) blog article. I’m aware of how to put ‘next’ and ‘previous’ buttons on a dynamic page, but I want to but the button on the **blog post page**.

What is the correct code snippet for this?

---

<div class="post-metadata">

**Author:** ![ovidiup76](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ovidiup76/32/14211_2.png) [@ovidiup76](https://forum.wixstudio.com/u/ovidiup76)\
**Post date:** [April 15, 2020, 9:51am UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/2 "2020-04-15T09:51:42Z")

</div>

Nobody can provide an answer for this question? I have the exact same need, thank you in advance for any idea.

---

<div class="post-metadata">

**Author:** ![neverend612](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/neverend612/32/21124_2.png) [@neverend612](https://forum.wixstudio.com/u/neverend612)\
**Post date:** [June 22, 2020, 12:20am UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/3 "2020-06-22T00:20:16Z")

</div>

I am in desperate need for an answer to this!!

---

<div class="post-metadata">

**Author:** ![ovidiup76](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ovidiup76/32/14211_2.png) [@ovidiup76](https://forum.wixstudio.com/u/ovidiup76)\
**Post date:** [June 22, 2020, 1:08pm UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/4 "2020-06-22T13:08:30Z")

</div>

I really think that Wix does not allow this function, for some unexplainable reasons.

---

<div class="post-metadata">

**Author:** ![rossboone](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/rossboone/32/16596_2.png) [@rossboone](https://forum.wixstudio.com/u/rossboone)\
**Post date:** [August 10, 2020, 10:41pm UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/5 "2020-08-10T22:41:58Z")

</div>

I really would like this Prev/Next post feature as well!! Pleassseee!!

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [August 10, 2020, 10:57pm UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/6 "2020-08-10T22:57:44Z")

</div>

Hello Ross,

like it seems to be, these were the last customizations/upgrades on Wix-Blog-system…

> **[New Customization Options for Your Blog | Partner Community](https://community.wix.com/partners/forum/partner-announcements/new-customization-options-for-your-blog)**
>
> You can now customize the layout of your 'All Posts' feed and your category pages to give your blog that perfect look. You can now choose from 6 new layouts that allow you to customize design elements of your blog.
> 
> What can you customize?
> 
> • The...

If you have a wished function which is still not implemented on wix, you can use the WISHLIST…  
I do not know if a Wix-Wishlist exists, but perhaps you could get it on CORVID-Wishlist…

[https://www.wix.com/corvid/wishlist?page=1](https://www.wix.com/corvid/wishlist?page=7)

---

<div class="post-metadata">

**Author:** ![ovidiup76](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ovidiup76/32/14211_2.png) [@ovidiup76](https://forum.wixstudio.com/u/ovidiup76)\
**Post date:** [August 11, 2020, 8:13am UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/7 "2020-08-11T08:13:23Z")

</div>

Still no upgrade regarding the Prev/Next post feature… ☹

---

<div class="post-metadata">

**Author:** ![circular\_connection](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/circular_connection/32/88870_2.png) [@circular\_connection](https://forum.wixstudio.com/u/circular_connection)\
**Post date:** [February 26, 2024, 12:40pm UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/8 "2024-02-26T12:40:56Z")

</div>

4 years later, still no improvement to this feature request. its a fundamental requirement yet given wix’s reputation, they can’t implement this till date is indeed surprising.

---

<div class="post-metadata">

**Author:** ![kkkk](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kkkk/32/97495_2.png) [@kkkk](https://forum.wixstudio.com/u/kkkk)\
**Post date:** [September 25, 2024, 5:49pm UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/9 "2024-09-25T17:49:01Z")

</div>

Almost 5 years later and still no update for this feature. This shows how unprofessional to not having such feature as a very big website builder and how dissapointing that is. I’m sure thousands of people are waiting for this feature. I hope we can see a better and developed Wix.

---

<div class="post-metadata">

**Author:** ![nillilia](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/nillilia/32/98686_2.png) [@nillilia](https://forum.wixstudio.com/u/nillilia)\
**Post date:** [January 17, 2025, 1:50pm UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/10 "2025-01-17T13:50:53Z")

</div>

Ugh still no improvement?

---

<div class="post-metadata">

**Author:** ![simone](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/simone/32/706_2.png) [@simone](https://forum.wixstudio.com/u/simone)\
**Post date:** [March 3, 2025, 9:56pm UTC](https://forum.wixstudio.com/t/next-button-on-a-blog-post-page/22251/11 "2025-03-03T21:56:54Z")

</div>

Chat GPT wrote this but it’s not working:  
import wixData from ‘wix-data’;  
import wixLocation from ‘wix-location’;

$w.onReady(function () {  
let currentSlug = wixLocation.path[1];  
console.log(“Current Slug:”, currentSlug);

```
wixData.query("Blog/Posts") // FIXED: Use "Blog/Posts"
    .eq("slug", currentSlug)
    .find()
    .then((results) => {
        if (results.items.length > 0) {
            let currentPost = results.items[0];
            console.log("Current Post Found:", currentPost.title);
            
            findNextPost(currentPost);
            findPrevPost(currentPost);
        } else {
            console.log("No matching blog post found.");
        }
    })
    .catch((err) => console.error("Error querying posts:", err));

```

});

function findNextPost(currentPost) {  
wixData.query(“Blog/Posts”) // FIXED  
.ascending(“datePublished”)  
.gt(“datePublished”, currentPost.datePublished)  
.limit(1)  
.find()  
.then((nextResults) =\> {  
if (nextResults.items.length \> 0) {  
console.log(“Next Post:”, nextResults.items[0].title);  
$w(“#nextButton”).link = `/post/${nextResults.items[0].slug}`;  
$w(“#nextButton”).show();  
} else {  
console.log(“No Next Post Found.”);  
}  
});  
}

function findPrevPost(currentPost) {  
wixData.query(“Blog/Posts”) // FIXED  
.descending(“datePublished”)  
.lt(“datePublished”, currentPost.datePublished)  
.limit(1)  
.find()  
.then((prevResults) =\> {  
if (prevResults.items.length \> 0) {  
console.log(“Previous Post:”, prevResults.items[0].title);  
$w(“#prevButton”).link = `/post/${prevResults.items[0].slug}`;  
$w(“#prevButton”).show();  
} else {  
console.log(“No Previous Post Found.”);  
}  
});  
}
