# Snsアイコンをヘッダーに表示したい

**URL:** <https://community.shopify.com/t/sns/102776>\
**Category:** 技術的なQ＆A\
**Created:** [February 27, 2022, 8:14am UTC](https://community.shopify.com/t/sns/102776 "2022-02-27T08:14:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Anonymous\_44fbe07fc59d9ccaacd70575fd5a5155](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/anonymous_44fbe07fc59d9ccaacd70575fd5a5155/32/194200_2.png) [@Anonymous\_44fbe07fc59d9ccaacd70575fd5a5155](https://community.shopify.com/u/Anonymous_44fbe07fc59d9ccaacd70575fd5a5155)\
**Post date:** [March 29, 2022, 9:04am UTC](https://community.shopify.com/t/sns/102776/2 "2022-03-29T09:04:21Z")

</div>

頂いているコードの3行目 {%- if social\_icons -%} の部分がheader.liquid内に記述のない条件分岐のため、その中に記載をされている内容が出力をされていない状況かと思います。

SNSを表示するために必要な部分のみを抜粋すると、以下のようなコードになります。

```markup
{%- assign socials = "Facebook Twitter Pinterest Instagram Tumblr Snapchat YouTube Vimeo" | split: ' ' -%}

  {%- for social in socials -%}
    {%- assign social_link = social | prepend: 'social_' | append: '_link' | downcase -%}
    {%- assign icon_link = social | prepend: 'icon-' | downcase -%}
    {%- if settings[social_link] != blank -%}
      - {%- include icon_link -%}
            {{ social }}
        
      
    {%- endif -%}
  {%- endfor -%}

```

デフォルトのDebutテーマの「header.liquid」内に上記コードを追加したところ、アイコンが表示されることを確認いたしました。

サーチやアカウントのアイコンと並べて表示する場合、112行目 div class=“site-header\_\_icons-wrapper”の下辺りに追加いただくと良いかと思います。（デザインは適宜CSSで調整ください）

ご参考になりましたら幸いです。

---

_[View the full topic](https://community.shopify.com/t/sns/102776)._
