Skip to content

Instantly share code, notes, and snippets.

@kmeister2000
Last active March 31, 2023 17:35
Show Gist options
  • Save kmeister2000/4f440b1bc9e35a81acbb3e632574fd7d to your computer and use it in GitHub Desktop.
Save kmeister2000/4f440b1bc9e35a81acbb3e632574fd7d to your computer and use it in GitHub Desktop.
Shopify - get the blog category for every article
{% comment %} By Stefan Bowerman and Gina Gregory {% endcomment %}
{% comment %} Shopify doesn't have a way to access article.blog directly so we have to parse out the url {% endcomment %}
{% assign blogHandle = article.handle | split: '/' | first %}
{% comment %}Access the blog object {% endcomment %}
{% blog = blogs[blog_handle] %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment