【無料】Shopifyに新着情報・お知らせ一覧を表示する方法|Shopifyアプリは不要

[Free] How to Display a News List on Shopify | Show Latest Updates with No App Required

Tsunライターチーム

Effectively displaying the latest updates and news for your customers is important on Shopify. This article introduces how to use Shopify's blog feature to implement a news list for free, without using an app. We'll walk through a simple, practical implementation method using HTML and CSS source code, step by step.

Output

The source code introduced here is HTML and CSS for implementing a news list section on your website.

The news list displays up to 5 of your latest blog posts as news items, each including a title and publish date. If there are 6 or more blog posts, a "View more" button is displayed, and clicking it takes you to the news list page.

See the actual news list display at the link below.

Check the news list

News List on a Computer

News list as viewed on a computer

News List on a Smartphone

News list as viewed on a smartphone

Preparation

Create a blog for your news list using Shopify's blog feature, and copy its handle ID.

The handle ID is the highlighted part in the attached image.

Where to find the blog's handle ID

Source Code

HTML Code

<div class="news-section">
  <h2 class="news-title">News</h2>
  <ul class="news-list">
    {% for article in blogs['corporate'].articles limit: 5 %}
      <li>
        <span class="date">{{ article.published_at | date: "%Y.%m.%d" }}</span>
        <a href="{{ article.url }}" title="{{ article.title }}">
          <span class="title">{{ article.title | truncate: 50, '...' }}</span>
        </a>
      </li>
    {% endfor %}
  </ul>

{% if blogs['corporate'].articles.size > 5 %}
  <div class="more-link-wrapper">
    <a href="{{ blogs['corporate'].url }}" class="more-link">View more</a>
  </div>
{% endif %}
</div>
  • For "corporate" in blogs['corporate'], enter the handle ID of the blog you copied during preparation.
  • To change the number of news items displayed, change the number "5" in the code below to the number of items you want to display
    • {% for article in blogs['corporate'].articles limit: 5 %}
    • {% if blogs['corporate'].articles.size > 5 %}

CSS Code

.news-section {
  text-align: center;
}

.news-title {
  text-align: center;
}

.news-list {
  display: inline-block;
  text-align: left;
  max-width: 1200px;
}

.news-list li {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #ccc;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-list .date {
  font-size: 14px;
  color: #888;
  margin-right: 20px;
  min-width: 80px;
}

.news-list a {
  color: #333;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-list a:hover .title,
.news-list a:focus .title {
  text-decoration: underline;
}

.more-link {
  display: inline-block;
  padding: 6px 24px;
  background-color: #ffffff;
  color: #000;
  text-decoration: none;
  border-radius: 25px;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s;
  border: 1px solid #000;
  margin-top: 10px;
}

.more-link:hover {
  background-color: #f9f9f9;
}

@media screen and (max-width: 480px) {
  .news-list {
    max-width: 100%;
    padding: 15px;
  }

  .news-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-list .date {
    margin-right: 0;
    margin-bottom: 5px;
  }

  .news-list .title {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }
}
  • Feel free to customize the CSS code to match your own design preferences.

How to Insert the Code Into Your Shopify Theme

This section explains how to insert the source code into the Dawn theme using the theme editor.

1 Go to Online Store > Themes  2 Click Customize on the Shopify theme where you want to insert the source code

1. Go to Online Store > Themes

2. Click Customize on the Shopify theme where you want to insert the source code

3. In the theme editor, go to the page where you want to insert the source code

4. Click "Add section"

5 Add a section block named "Custom Liquid"  6 Insert your HTML code into the Liquid code within "Custom Liquid"

5. Add a section block named "Custom Liquid"

6. Insert your HTML code into the Liquid code within "Custom Liquid"

7. Insert your CSS code into the custom CSS within "Custom Liquid"

※ Custom CSS has a 500-character limit, so if it doesn't fit, add it to the Liquid code within "Custom Liquid" in the format [<style> CSS code </style>] instead.

8. Click "Save" at the top right of the screen

In Closing

This article introduced how to use Shopify's blog feature to display a news list. Using this feature lets you clearly provide the latest information to your customers. Use the code introduced in this article as a base, and customize it to match your own store's design.

Shopify's blog feature can be used for many purposes beyond displaying a news list. For example, it can also be used to introduce new products, share messages from your store, and announce events. We encourage you to make good use of Shopify's blog feature to enrich your communication with customers.

The blog article below introduces ways to make use of Shopify's blog feature. Please use it as a reference.

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

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

Back to blog
  • Shopifyに送料無料バーを設置 アプリ5選も紹介

    How to Add a Free Shipping Bar to Shopify: 5 Re...

    Tsun ライターチーム

    Compare five Shopify apps that show shoppers how much more they need to spend for free shipping. Choose an app based on your shipping conditions and where you want the...

    How to Add a Free Shipping Bar to Shopify: 5 Re...

    Tsun ライターチーム

    Compare five Shopify apps that show shoppers how much more they need to spend for free shipping. Choose an app based on your shipping conditions and where you want the...

  • Shopifyに棚卸し機能が登場!管理画面・POSでの操作手順を解説

    Shopify Introduces Stock Counts: How to Use The...

    Tsun ライターチーム

    Use Shopify's built-in stock counts to count inventory by location. Learn how to create a count and approve stock discrepancies in the Shopify admin, and how to count stock in...

    Shopify Introduces Stock Counts: How to Use The...

    Tsun ライターチーム

    Use Shopify's built-in stock counts to count inventory by location. Learn how to create a count and approve stock discrepancies in the Shopify admin, and how to count stock in...

  • Shopify Flowで商品の価格・タグ・メタフィールドの変更を検知する方法

    How to detect changes to product prices, tags, ...

    Tsun ライターチーム

    Use Shopify Flow’s Product updated trigger to detect changes to prices, tags, and metafields. See how to tag products for review when prices change and how to test the workflow.

    How to detect changes to product prices, tags, ...

    Tsun ライターチーム

    Use Shopify Flow’s Product updated trigger to detect changes to prices, tags, and metafields. See how to tag products for review when prices change and how to test the workflow.

  • Shopifyのファイル管理を徹底解説|対応形式・容量上限・フォルダ整理の方法

    Shopify File Management: Formats, Storage Limit...

    Tsun ライターチーム

    Learn how to manage images, videos, and PDFs in the Shopify admin. Check supported file formats and plan limits, then learn to create folders, move files, search, and delete.

    Shopify File Management: Formats, Storage Limit...

    Tsun ライターチーム

    Learn how to manage images, videos, and PDFs in the Shopify admin. Check supported file formats and plan limits, then learn to create folders, move files, search, and delete.

  • Shopifyと連携できる外部AI7選!対応機能・接続方法を比較

    7 AI Tools That Connect to Shopify: Features an...

    Tsun ライターチーム

    Compare seven AI tools that connect to Shopify. See which ones fit tasks like adding product images, analyzing sales, and working with Microsoft 365, and check the permissions and limits...

    7 AI Tools That Connect to Shopify: Features an...

    Tsun ライターチーム

    Compare seven AI tools that connect to Shopify. See which ones fit tasks like adding product images, analyzing sales, and working with Microsoft 365, and check the permissions and limits...

  • Shopifyのストア分析・レポートを画像付きで解説|使い方からカスタマイズまで

    A visual guide to Shopify Analytics and reports...

    Tsun ライターチーム

    Learn how to break down sales and sessions in Shopify Analytics, compare data across the session measurement update, and use bubble maps, custom data, and annotations.

    A visual guide to Shopify Analytics and reports...

    Tsun ライターチーム

    Learn how to break down sales and sessions in Shopify Analytics, compare data across the session measurement update, and use bubble maps, custom data, and annotations.

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.