Minimal Theme - How to put blog posts on Home page

Highlighted
Tourist
10 0 2

Any ideas? Basically, I want to have the blog posts appear on the home page. I've tried to take the snippet out of the blog.liquid template and insert it into the index.liquid template but this method does not appear to work.

Any tips appreciated.

Thanks

0 Likes
Shopify Expert
9764 86 1510

See more info on the Blog wiki.

But in essence:

<h3>Recent Posts</h3>
<ul>
{% for article in blogs[blog.handle].articles limit: 5 %}
  <li>{{ article.title | link_to: article.url }}</li>
{% endfor %}
</ul>

Just remember to replace blog.handle with whatever your blog handle is (eg: news). 

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Tourist
10 0 2

I have tried inserting the following snippet of code on the home page:


<h3>Recent Posts</h3>
<ul>
{% for article in blogs[News].articles limit: 5 %}
  <li>{{ article.title | link_to: article.url }}</li>
{% endfor %}
</ul>

And I am not achieving the desired result. I have tried 'News' , 'news' , 'blog.news' , 'blog.News' , 'blogs.news' , 'blogs.News' , etc. Nothing has yet been able to display the recent blog posts on the home page. The title of the blog I am posting to is 'News'. Please see my website for reference:

http://papersclothingco.com

Please let me know your thoughts.

Thanks

0 Likes
Shopify Expert
9764 86 1510

Make sure the handle is a string, or a string within a variable you've already set.

Such as

{% for article in blogs["news"].articles limit: 5 %}

/* OR */

{% assign my_supa_doopa_handle = "news" %}
{% for article in blogs[my_supa_doopa_handle].articles limit: 5 %}

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Tourist
10 0 2

I'd like to have the blog content posted on the homepage, not just the blog title with a link to the post.

Is there any way of doing this?

0 Likes
Shopify Expert
9764 86 1510

Take a look at the docs to see what you can access for the Article object. Article content is just simply:

{{ article.content }}

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes