HELP! How to add blog posts to homepage?

Highlighted
New Member
1 0 0

Struggled to find a working answer on Google and after an hour of trying I've landed here! ...surely lots of people have figured out how to add Blog posts to the homepage?

I just basically want the current standard Blog posts page to feature somewhere on my homepage.

I'm using the Venture theme.

Many thanks,

Anthony

0 Likes
Shopify Expert
41 1 8

I struggled with this same question! Here's what I ended up with for my client. You'll need to know the name of your blog and include it in the first line where I have blogs.[your blog name] : 

{% assign blog = blogs.Blog %}
      {% paginate blog.articles by 4 %}
        {% for article in blog.articles %}
      	<div>
          <div class="blog-article-header">
            <div class="blog-article-header-date">
              <span class="day">{{ article.published_at | date: '%d'}}</span>
              <span class="month">{{ article.published_at | date: '%b'}}</span>
            </div>
            <h2><a href="{{article.url}}">{{ article.title }}</a></h2>
          </div>

          <div>
            {{ article.content | truncatewords: 50 }}
            <p><a href="{{ article.url }}">{{ 'blogs.article.read_more' | t }} &rarr;</a></p>
          </div>

          {% if blog.comments_enabled? %}
            <p><a href="{{article.url}}#comments">{{ article.comments_count }} comments</a></p>
          {% endif %}
      </div>
      {% endfor %}
      </div>
  	  {% endpaginate %}

 

2 Likes
New Member
3 0 0

Where did you place this code?

0 Likes
Shopify Expert
41 1 8

You can place this in whatever liquid template file you want your blog to show up - if you want it on your homepage then it would go in the index.liquid file. 

Feel free to reach out via my expert profile

1 Like
New Member
3 0 0

Thank you. This was exactly what I was looking for.

0 Likes
New Member
2 0 0

I have the same problem, I just added to index.liquid but don´t know where, can someone help? 

 

thanks!

0 Likes
New Member
11 0 0

This code isnt working for me? :(

0 Likes
Shopify Partner
8 0 0
New Member
1 0 0

Finally one that works with only slight modifications for looks.

0 Likes
Shopify Partner
4 0 0

Hello Austin, thank you very much for the info.

 

Is possible add the post image and make a filter by tag?

 

Thank you very much.

0 Likes