Skip to content

Instantly share code, notes, and snippets.

@Chrisedmo
Created July 31, 2012 11:29
Show Gist options
  • Save Chrisedmo/3216357 to your computer and use it in GitHub Desktop.
Save Chrisedmo/3216357 to your computer and use it in GitHub Desktop.
Shopify: Latest Blog Posts
.widget .latest-blog-posts-list {
margin: 0;
list-style: none;
}
.widget .latest-blog-posts-list li {
margin: 0 0 10px 0;
padding: 0 0 10px 0;
border-bottom: dotted 1px #CCC;
background: none;
word-wrap: break-word;
line-height: 1.3em;
list-style: none;
}
{% comment %}
Edit the 2 values right below: what's your blog handle and how many articles do you want to show?
{% endcomment %}
{% assign your_blog_handle_here = 'news' %}
{% assign how_many_articles_to_show = 5 %}
<!-- START OF LATEST BLOG POSTS -->
<div class="widget">
<div class="widget-header">
<h3>Latest Blog Posts</h3>
</div>
<div class="latest-blog-posts-wrapper">
<ul class="latest-blog-posts-list">
{% for article in blogs[your_blog_handle_here].articles limit: how_many_articles_to_show %}
<li>{{ article.title | link_to: article.url }}</li>
{% endfor %}
</ul>
</div>
</div>
@garretthyder
Copy link

Thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment