Hello, I would like to add a previous and next article button to the bottom of my blog posts. This is what I’ve put together, but I’m having issues running it this way.
I would also like to have physical buttons, rather than the text links.
Thank you in advance.
{% if blog.next_article !- nil %}
{% endif %}
{% if blog.next_article !- nil %}
{% endif %}
Hi @Cody_w36 ,
Please change all code:
{% if blog.next_article !- nil %}
{% endif %}
{% if blog.next_article !- nil %}
{% endif %}
Hope it helps!
Thank you!
for some reason I can’t save the file though, shows a sentax error from the !- nil.
Hi @Cody_w36 ,
Please change code:
{% if blog.next_article %}
{% endif %}
{% if blog.next_article %}
{% endif %}
1 Like
That did it! Would love if the CSS looked like one of my other buttons though.
Hi @Cody_w36 ,
Please send me the link showing this, I will help you check it
It’s near the bottom of this page.
HTTPS://barbellbasecamp.com
Hi @Cody_w36 ,
Please change all code:
{% if blog.next_article %}
{% endif %}
{% if blog.next_article %}
{% endif %}
Hello. I also used this code and it worked. However, is it possible to achieve this appearance?: https://prnt.sc/s-f9SJI1wSs-
1 Like
Has anyone provided code for the appearance you are asking about? I would be interested as well.
Hi,
I can’t get this to work properly. I got around 30 blog posts in a certain blog and have implemented the accepted solution, but the links doesn’t deliver “next” and “previous” blog posts, instead it delivers only two different blog posts.
This is the blog: https://bok.hstrom.se/blogs/boktips-referat
The “next post” option always (static) leads to the second first post in the blog, except when I go that post, then it works and goes to the third post. But on the third post, it leads back to this second first post blog…
The “previous post” option always leads to the most recent blog post in the blog, except when I is viewing the most recent post, then it points to the next recent post (as it should).
So only on 2 blog posts the liquid code works properly… Any idea?
This is my code:
{% if blog.next_article %}
{% endif %}
{% if blog.next_article %}
{% endif %}
If I
I have this same problem - it is extremely frustrating when you are trying to have a blog that goes sequentially, like chapters in a book. My blog is https://iamekho.com/blogs/i-am-ekho and while I was able to use the ‘publish’ date to force it, when on mobile there is some sort of built in ‘next’ article when you scroll far enough through one and it goes backwards. SUPER FRUSTURATING>
1 Like