Title: トップ画面のギャラリーショートコードを非表示にしたい
Last modified: 2016年7月30日

---

# トップ画面のギャラリーショートコードを非表示にしたい

 *  [blue_patagonia](https://ja.wordpress.org/support/users/blue_patagonia/)
 * (@blue_patagonia)
 * [12年、 7ヶ月前](https://ja.wordpress.org/support/topic/%e3%83%88%e3%83%83%e3%83%97%e7%94%bb%e9%9d%a2%e3%81%ae%e3%82%ae%e3%83%a3%e3%83%a9%e3%83%aa%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e9%9d%9e%e8%a1%a8%e7%a4%ba/)
 * ワードプレス初心者です。ご存知の方がいらっしゃいましたら教えてください。
 * トップ画面の記事抜粋文の中にギャラリーショートコードが表示されてしまいます。
 * 例：
    [gallery type="rectangular" ids="1102,1103,1105,1104" link="file"]
 * 上記のテキスト部分をトップ画面で非表示にすることは可能なのでしょうか？
    もし可能
   であれば、どのファイルにどのような構文を追加すればよいのか教えていただけますで
   しょうか。
 * なお、使っているテーマはSimply-VisiOnです。よろしくお願いいたします。

4件の返信を表示中 - 1 - 4件目 (全4件中)

 *  [nobita](https://ja.wordpress.org/support/users/nobita/)
 * (@nobita)
 * [12年、 7ヶ月前](https://ja.wordpress.org/support/topic/%e3%83%88%e3%83%83%e3%83%97%e7%94%bb%e9%9d%a2%e3%81%ae%e3%82%ae%e3%83%a3%e3%83%a9%e3%83%aa%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e9%9d%9e%e8%a1%a8%e7%a4%ba/#post-174382)
 * こんにちは
 * [https://codex.wordpress.org/Function_Reference/strip_shortcodes](https://codex.wordpress.org/Function_Reference/strip_shortcodes)
 * を参照してください
 *  トピック投稿者 [blue_patagonia](https://ja.wordpress.org/support/users/blue_patagonia/)
 * (@blue_patagonia)
 * [12年、 7ヶ月前](https://ja.wordpress.org/support/topic/%e3%83%88%e3%83%83%e3%83%97%e7%94%bb%e9%9d%a2%e3%81%ae%e3%82%ae%e3%83%a3%e3%83%a9%e3%83%aa%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e9%9d%9e%e8%a1%a8%e7%a4%ba/#post-174383)
 * nobitaさん、返信ありがとうございます。
    基本的なところがわからなくて恐縮なんですが・・・
   下記の方法で合ってますでしょうか？
 * ①以下をfunctions.phpに適用
 * > function remove_shortcode_from_index($content) {
   >  if ( is_home() ) { $content
   > = strip_shortcodes( $content ); } return $content; } add_filter(‘the_content’,‘
   > remove_shortcode_from_index’);
 * ②以下をテーマのindex.phpに適用
 * > <?php strip_shortcodes( $content ); ?>
 * 試してみたんですけど、ショートコードがトップ画面に反映されたままです。
    どうしたら
   うまく行くのか教えていただけませんか？
 * ちなみにサイトはこちらです。
    [http://photowise.main.jp](http://photowise.main.jp)
 *  [nobita](https://ja.wordpress.org/support/users/nobita/)
 * (@nobita)
 * [12年、 7ヶ月前](https://ja.wordpress.org/support/topic/%e3%83%88%e3%83%83%e3%83%97%e7%94%bb%e9%9d%a2%e3%81%ae%e3%82%ae%e3%83%a3%e3%83%a9%e3%83%aa%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e9%9d%9e%e8%a1%a8%e7%a4%ba/#post-174387)
 * テーマで、要約を表示する部分が、`the_excerpt()`を使っている場合は、フィルタフック
   をthe_contentではなく、the_excerptにする必要があります。
 * the_contentを基にして、要約表示をしている場合は、
 *     ```
       add_filter('the_content', 'remove_shortcode_from_index',99);
       ```
   
 * 第三引数に、10より大きい数値を指定してみてください。
 *  トピック投稿者 [blue_patagonia](https://ja.wordpress.org/support/users/blue_patagonia/)
 * (@blue_patagonia)
 * [12年、 7ヶ月前](https://ja.wordpress.org/support/topic/%e3%83%88%e3%83%83%e3%83%97%e7%94%bb%e9%9d%a2%e3%81%ae%e3%82%ae%e3%83%a3%e3%83%a9%e3%83%aa%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e9%9d%9e%e8%a1%a8%e7%a4%ba/#post-174392)
 * ありがとうございます。
    functions.phpを見る限り、the_excerptではないようでした。
 * > add_filter(‘the_content’, ‘remove_shortcode_from_index’,99);
 * こちらも試してみましたが、やはりトップ画面にはギャラリーショートコードが表示さ
   れたままです・・・。

4件の返信を表示中 - 1 - 4件目 (全4件中)

 トピック「トップ画面のギャラリーショートコードを非表示にしたい」には新たに返信する
ことはできません。

 * フォーラム: [使い方全般](https://ja.wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4件の返信
 * 2人の参加者
 * 最後の返信者: [blue_patagonia](https://ja.wordpress.org/support/users/blue_patagonia/)
 * 最後の活動: [12年、 7ヶ月前](https://ja.wordpress.org/support/topic/%e3%83%88%e3%83%83%e3%83%97%e7%94%bb%e9%9d%a2%e3%81%ae%e3%82%ae%e3%83%a3%e3%83%a9%e3%83%aa%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e9%9d%9e%e8%a1%a8%e7%a4%ba/#post-174392)
 * 状態: 未解決

## トピック

### 人気のトピック

### 返信がないトピック

### サポート関連ではないトピック

### 解決済みのトピック

### 未解決のトピック

### すべてのトピック
