【TIPS】Shopifyのブログカードに文字数制限をかける方法

How to Set Character Limits for Shopify Blog Cards

Tsunライターチーム

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."

A Shopify blog post 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

Before applying a character limit to the blog card

After: After Applying a Character Limit to the Blog Card

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'

(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'

(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

(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.

👆️目次はShopifyアプリ「RuffRuff 目次作成」を利用

👆️Table of contents by the Shopify app RuffRuff Table of Contents

Back to blog
  • 【アプリなし】Shopifyテーマのカウントダウンタイマーを50件比較

    [No app required] Countdown timers across 50 Sh...

    Tsun ライターチーム

    We reviewed 50 Shopify themes. On all 39 with a timer, we could still add products to the cart and reach checkout after the deadline. See where to find the...

    [No app required] Countdown timers across 50 Sh...

    Tsun ライターチーム

    We reviewed 50 Shopify themes. On all 39 with a timer, we could still add products to the cart and reach checkout after the deadline. See where to find the...

  • Shopifyテーマの予約販売の対応可否を50件比較|41テーマで予約ボタンを確認

    Pre-order support across 50 Shopify themes | Pr...

    Tsunライターチーム

    We reviewed the official help and the theme editor for 50 Shopify themes. We tried the settings on a development store and confirmed pre-order buttons with no app on 41...

    Pre-order support across 50 Shopify themes | Pr...

    Tsunライターチーム

    We reviewed the official help and the theme editor for 50 Shopify themes. We tried the settings on a development store and confirmed pre-order buttons with no app on 41...

  • Shopify Protect: Rule Builderとは?機能・メリット・料金を解説

    What is Shopify Protect: Rule Builder? Features...

    Tsun ライターチーム

    Explore the features, pricing, and considerations for Shopify's fraud prevention app, Shopify Protect: Rule Builder. Learn about custom rules, testing against orders from the past 90 days, the waitlist, Japanese-language...

    What is Shopify Protect: Rule Builder? Features...

    Tsun ライターチーム

    Explore the features, pricing, and considerations for Shopify's fraud prevention app, Shopify Protect: Rule Builder. Learn about custom rules, testing against orders from the past 90 days, the waitlist, Japanese-language...

  • Shopifyアプリ「ChatGPT」とは?機能・料金・日本での利用条件を解説

    What Is the Shopify App “ChatGPT”? Features, Pr...

    Tsun ライターチーム

    An introduction to the features and pricing of OpenAI’s Shopify app “ChatGPT.” It explains product information sync, information management and analytics in Business Hub, ad delivery, Business Agent features, and...

    What Is the Shopify App “ChatGPT”? Features, Pr...

    Tsun ライターチーム

    An introduction to the features and pricing of OpenAI’s Shopify app “ChatGPT.” It explains product information sync, information management and analytics in Business Hub, ad delivery, Business Agent features, and...

  • Shopifyで使える決済方法一覧|手数料・導入サービス・選び方

    [Complete Guide] A Roundup of Payment Methods A...

    Tsunライターチーム

    This article gives a detailed explanation of the many payment methods available on Shopify and their respective payment processing fees and transaction fees. We also introduce handy Shopify apps that...

    [Complete Guide] A Roundup of Payment Methods A...

    Tsunライターチーム

    This article gives a detailed explanation of the many payment methods available on Shopify and their respective payment processing fees and transaction fees. We also introduce handy Shopify apps that...

  • GMOイプシロンの手数料・決済方法・入金サイクル|Shopifyの条件も解説

    GMO Epsilon Fees, Payment Methods, and Payout C...

    Tsun ライターチーム

    GMO Epsilon payment methods and fees, organized by contract type. Covers Shopify-specific terms, payouts, authorization and capture deadlines, refunds, and cancellation. Also introduces ways to use apps to control which...

    GMO Epsilon Fees, Payment Methods, and Payout C...

    Tsun ライターチーム

    GMO Epsilon payment methods and fees, organized by contract type. Covers Shopify-specific terms, payouts, authorization and capture deadlines, refunds, and cancellation. Also introduces ways to use apps to control which...

1 of 6
  • AI仮想顧客の改善ツール「SimGym」を使ったら売上はどうなった?実行から3か月後までの記録

    What Happened to Sales After Using SimGym, an A...

    テキサス・アユミ

    A record of trying SimGym on the miso specialty store ドットミソ, from checking the proposals through carrying out changes to the look-back three months later. It covers how the order...

    What Happened to Sales After Using SimGym, an A...

    テキサス・アユミ

    A record of trying SimGym on the miso specialty store ドットミソ, from checking the proposals through carrying out changes to the look-back three months later. It covers how the order...

  • 【ストアインタビュー後編】やりながら育てるShopify。「野菜をMOTTO」の試行錯誤:モンマルシェ株式会社 河野雄士さん

    [Store Interview, Part 2] Building and Growing ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." An in-depth look at our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its...

    [Store Interview, Part 2] Building and Growing ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." An in-depth look at our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its...

  • 【ストアインタビュー前編】 ECが主戦場でも、ECが目的ではない。「野菜をMOTTO」が貫くEC戦略:モンマルシェ株式会社 河野雄士さん

    [Store Interview, Part 1] Even When E-Commerce ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." Part 1 of our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its e-commerce...

    [Store Interview, Part 1] Even When E-Commerce ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." Part 1 of our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its e-commerce...

1 of 3
  • Our Editorial Process

    For readers new to e-commerce and Shopify, we write our articles with care to explain difficult commerce and marketing terms, along with how everything works from building a store through to selling, as “gently,” “clearly,” and “accurately” as we can.

    Learn more 
  • About the information on this site

    The information published here is based on Tsun Inc.’s own experience and research. While we make every effort to publish information that is as “current” and “accurate” as possible, we cannot fully guarantee its contents. Tsun Inc. accepts no liability whatsoever for any damages arising from this site. If you find an error in the information published here, we would be grateful if you would contact Tsun Inc.