Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Like product, I can show all product by doing Navigation > Add menu item > All collections
But I can't do >all categories for blogs, is there way to show all of the blogs in one page?
Thank you so much for your help.
You will need to code it.
Note: Here blog1 and blog2 and blog3 are your blog handles. Go to your respective blog pages and copy the part after the last '/'. Like:
{% assign blog_handles = "blog1,blog2,blog3" | split: "," %}
{% for handle in blog_handles %}
{% for article in blogs[handle].articles %}
<h2><a href="{{ article.url }}">{{ article.title }}</a></h2>
{% endfor %}
{% endfor %}
Go view the page you just created. It will display your article's heading and clicking them will take you to the articles. (Article is alias for blog posts in Shopify). Read more article object properties here: https://shopify.dev/docs/themes/liquid/reference/objects/article
Thank you! It works but all the template is lost & no blog pic is showing, is there anyway to keep the template while showing all the blogs? @oscprofessional
Try this
Step 1: Create the special "Blogs" linked-list:
Step 2: Edit your custom page template
{% for link in linklists.blogs.links %}
{% assign blog = link.object %}
{% for article in blog.articles %}
<h2><a href="{{ article.url }}">{{ article.title }}</a></h2>
{% endfor %}
{% endfor %}
Let me know if this solves your problem or if you need further help!
Hello! I followed your step 1 which worked and then had the same issue of no photos showing in the all blogs listing (https://oneconsciousearth.shop/pages/all-knowledge)
Attempted step 2 and it hasn't changed anything.
Is there another way or maybe more detailed instructions for step 2 (to make sure I am getting it right)?
How do you do this in Dawn theme with json template?
Hello @oscprofessional, thank you for the above solution which is working. Also could you please add a code on how we can implement the pagination and order of displaying the post based on the date for the above solution?
Thank you
Hey, this looks like it might work for what I want to do, but what about pagination? I can't have the page load 400+ items...
Hello, I am using 'Taste' theme and unfortunately this solution does not work for that anymore. I have looked through the code and I cannot find {{ page.content }} anywhere in that code when a new template is created. Do you know something may have changed in the shopify templates over the last couple years? I am creating a store now and want to show all blog posts on the same page for customers to browse but unfortunately, I am unable to do so. Can you help please? Thanks!
That's also my question. Thank you
Here's one simple way:
Create a new page template by going to Online Store > Themes > Customize, then select Pages from the top drop-down menu and 'Create Template'. In the new template, simply add a section after the page content called 'Blog posts', then select a category.
Next, add another section below this and select a different category. Repeat this until you have three (or four) blog posts displayed per blog category with a 'View all' button so users can explore all posts from any category.
Hope this helps someone!
This is the solution I needed! Easy to understand and implement. Thank you for sharing.
First, thank you so much for this! You are a life saver.
One quick question though (and my apologies if I've missed something obvious) but so I've done this, and now I can see the all-blogs in my theme editor, all the blogs are there, but I can't figure out how to get it to show up on my page. It doesn't show when trying to edit the navigation or my main menu, I can only see all-blogs in the template editor.
Sorry this is all still very new to me 😅
Thanks again!
I'm glad this has helped you!
Have you applied the 'all-blogs' template to a page? If not, pick a page to apply it to or create a new one (Online Store > Pages) and under 'Theme template', select the all-blogs template you created. You can then add that page to your navigation (Online Store > Navigation).
Let me know if you have any other questions.
That must be where I'm doing something wrong then, in creating the template. I can see the template I created on my theme editor:
but when I got to my pages, nothing appears under "theme template" except for "default" and "contact."
... Now that I'm saying all this though I'm thinking maybe I should have made the template under "Pages" and not under "Blog" 🤔 I'm going to try that. Thank you again for your help! I really appreciate you taking the time.
Update: That worked, thank you again!
This Worked! Thanks.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024