For anyone using Shopify, optimizing how your blog cards are displayed is an important point. In particular, if a blog post's description text is too long, it can hurt the user's browsing experience. In this article, we'll take a detailed look at how to set a character limit on blog card descriptions when using Shopify's Dawn theme or Rise theme. This lets you automatically truncate the description with "…" whenever it exceeds a certain number of characters, giving you a neat, easy-to-read display.
What Is a Blog Card?
In this article, we refer to a blog post displayed using the "Blog posts" section available in the Dawn and Rise themes, among others, as a "blog card."

How to Set a Character Limit on Blog Cards
In this section, we'll introduce how to set a character limit on the blog post description text in a blog card.
Result
By following the method introduced in this article, you can have the blog post description text in a blog card truncated with "…" whenever it exceeds 40 characters.
Before: Before Applying a Character Limit to the Blog Card

After: After Applying a Character Limit to the Blog Card

Prerequisites
The method introduced in this article is for the Rise theme.
Please keep in mind that for other Shopify themes, the settings introduced here may not work correctly.
For Shopify themes provided by Shopify, such as the Dawn theme, we believe there's a good chance the method in this article will work to apply a character limit.
How to Set a Character Limit

(1) Go to Online Store > Themes
(2) Click the three-dot menu for the theme you want to apply the character limit to
(3) Click "Edit code"

(4) In the code editor, select the "article-card.liquid" file
(5) Find the following code in "article-card.liquid"
{{ article.excerpt | strip_html | truncatewords: 30 }}
{{ article.content | strip_html | truncatewords: 30 }}

(6) Change the code from (5) to the code below
{{ article.excerpt | strip_html | truncate: 40, '…' }}
{{ article.content | strip_html | truncate: 40, '…' }}
* When adjusting the character limit, change the number in "truncate: 40" as needed.
(7) Click "Save"
Conclusion
In this article, we explained how to set a character limit on Shopify blog cards. If you're using the Dawn or Rise theme, you can limit the description text to a set number of characters and truncate any excess with "…" through a simple code edit. This lets you provide blog cards that are easy for users to read and well organized. Please note that if you're using a different theme, the same steps may not work correctly. When adjusting the character limit, you can flexibly change it by editing the number in the code.
Finally, the blog article below introduces the features and benefits of Shopify's blog functionality, along with use cases. Please take a look.
