Hi,
Achieving what you want with several Shopify blog categories (blogs) is not the easiest way as you will face some issues to order your blog posts by date and to paginate which will be bad for performance if you have a lot of blogs.
Another method exists to create blog categories using a built-in Shopify functionality, the tags. Here is how to use it for your store.
The method:
Let’s say we have three blog categories defined in Shopify: Interviews, Recipes, and Tutorials.
We will define tags for each category, tag our blog posts with these tags and move all our articles into a new single category, for instance, “journal” which will be our “All posts” category.
We will then add navigation in our blog template to filter articles based on tags.
Advantages of this method:
- You will have an all-posts category that can be paginated and that is ordered based on the blog publication date
- You can still filter your posts based on categories
- A blog post can be in several categories
Step-by-step tutorial:
Be careful. This method can require some coding skills, particularly for applying custom styles to the HTML navigation
-
Define a list of tags for each category:
First, define tags that represent each of your categories. For instance, you could use ‘Interviews’, ‘Recipes’, and ‘Tutorials’ as your tags. Be careful, as tags are case-sensitive, and you need to use the same tag for all posts in a category
-
Tag the blog posts in Shopify
Next, you’ll need to go through your existing blog posts and assign each post to one or more of the tags you’ve defined.
Navigate to the blog post → In the “Tags” section, type the appropriate tag according to the blog’s category → Save
-
Create a new blog category (or use an existing one)
In Shopify, what we often refer to as ‘categories’ are different blogs.
For this method, you will need to create a new blog (which acts as a category) or select an existing one to house all your posts.
If you want to create a new blog, go to Blog posts → Click “Manage blogs” → Click “Add blog” button → Give a name to your blog, let’s say “Journal”
-
Move all the blog posts into the category
Once you’ve created your new blog or chosen an existing one, you’ll need to move all of your blog posts into this ‘category’. To move a post, navigate to the blog post and change its blog assignment (right column) → Save
-
Create an HTML navigation filtered by tags
Now, all your blog posts are tagged and assigned in one unique category.
Next, you’ll need to edit your theme’s liquid files to create a navigation bar that filters your blog posts based on tags.
In your blog.liquid file (in template) or main-blog.liquid (for online store 2.0 themes), create links that use the URL structure /blogs/journal/tagged/tag-name, replacing ‘journal’ with the handle of your blog and ‘tag-name’ with each of your tags.
Here’s a simple example of what the code might look like:
You can then customize the CSS of this code to apply theme’s style to the navigation.
Create tag-based navigation using an app:
If you don’t want to code and are open to using an app to achieve create your navigation, you can also use our Bloggle app.
The Bloggle app comes with a built-in blog landing customization feature that will enable you to easily use the same method without coding skills (Take a look at this article in our documentation → https://bloggle.helpdocs.io/article/s5ev272t7t-create-a-filtered-navigation)
Here’s an image illustrating my answer:
While Bloggle can resolve your current issue, it offers much more:
- Design stunning layouts for your blog posts and landing pages, ensuring a captivating user experience.
- Create responsive blogs with a variety of sections: images, videos, newsletter forms, and more.
- Seamlessly embed your products into your posts - single product, product gallery, or product grid. This integration converts your readers into potential customers.
- Boost your SEO with our real-time scoring tool, making your content easier to find.
- Craft engaging content using our built-in templates or create your own for a personalized touch.
- Integrate your theme’s buttons and headings for a cohesive design.
- Utilize the power of AI to swiftly and efficiently generate exceptional content.
Moderator Edit
Best,
Bloggle Team