Blog Filter & Articles Search

Elevate your Shopify store's blog experience with our tailored Blog Filter & Articles Search customization, designed to enhance content discoverability without the need for external apps.

Blog Filter & Articles Search
1 sections

Blog Filter

We will guide you on how to create the Blog filter by Article tag

  • Step 1
  • From Shopify Admin Dashboard > Online Store > Themes > ... button > Edit code

  • Step 2
  • Search or Scroll the file list on the left to find the file name "main-blog.liquid" within Snippets. (Depending on your store's theme, it will have different files. We will guide based on Dawn theme structure) .

  • Step 3
  • Add the code below to the line#24

    code
    {% if blog.tags.size > 0 %}
          <div class="blog-filter">
            <div class="list-group">
              <ul id="BlogTagFilter" class="tag-list" style="display: flex; gap: 20px;">
                <li>Filter by:</li>
                {% if request.path contains 'tagged' %}
                  {% assign filter_name = request.path | split: 'tagged/' %}
                  {{ filter_name[1] | replace: '-', ' ' | capitalize }}
                {%  else %}
                  <li>
                    <a href="{{ blog.url }}" class="button">
                      {{ 'All Topics' }}
                    </a>
                  </li>
                  {% for tag in blog.all_tags %}
                  <li>
                    <a href="{{ blog.url }}/tagged/{{ tag | handleize }}" class="button">
                    {{ tag }}
                    </a>
                  </li>
                  {% endfor %}
              {% endif %}
              </ul>
            </div>
          </div>
        {% endif %}

  • Step 4
  • Also you can add CSS style, it's additional

    css
    <style>
      .list-group {
        text-align: center;
      }
      ul#BlogTagFilter {
    	list-style: none;
    	padding-top: 10px;
    	}
      ul#BlogTagFilter li {
    	display: inline;
        margin: 5px;
    	}
    </style>

    If you want show this tag on each Article card on Blog page, let use the code:

    code
    <ul>
          {% for tag in article.tags %}
            <li><a href="{{ blog.url }}/tagged/{{ tag | handleize }}" class="button">{{ tag }}</a></li>
          {% endfor %}
    </ul>

    Using below code

    css
    <form method="get" action="/search">
        <input type="hidden" name="type" value="article" />
        <input type="text" name="q" />
        <input  type="submit" value="Search" />
    </form>
    Tags

    Related Articles

    Boosting Customer Retention with Email and SMS Marketing on Shopify
    Tips & Tricks

    Boosting Customer Retention with Email and SMS Marketing on Shopify

    Learn how to leverage email and SMS marketing to drive repeat sales, increase brand exposure, and improve customer retention for your Shopify store. Discover practical strategies and actionable tips to enhance your marketing efforts. From personalized messages to timely re-engagement campaigns, we've got you covered.

    June 28, 20262 min
    Connect GitHub to Shopify
    Tips & Tricks

    Connect GitHub to Shopify

    Connecting GitHub to Shopify allows you to version control your theme code, collaborate with your team, and deploy changes smoothly

    June 22, 202610 min
    10 Actionable Shopify SEO Tips to Boost Your Store's Ranking
    Tips & Tricks

    10 Actionable Shopify SEO Tips to Boost Your Store's Ranking

    Improve your Shopify store's visibility and drive more sales with these 10 actionable SEO tips. From keyword optimization to site speed and mobile-first design, learn how to boost your store's ranking and attract more customers. Start optimizing your store today and watch your sales soar.

    June 20, 20264 min
    How to Add a Smooth Back-to-Top Button to Your Shopify Theme
    Tips & Tricks

    How to Add a Smooth Back-to-Top Button to Your Shopify Theme

    Learn how to add a back-to-top button to your Shopify theme with lightweight CSS and JS, improving user experience and navigation. Follow our step-by-step tutorial for a seamless implementation.

    June 18, 20263 min