Title: Conditional Tags Shortcode
Author: shazdeh
Published: <strong>2015年1月28日</strong>
Last modified: 2020年5月26日

---

プラグインを検索

このプラグインは **WordPress の最新3回のメジャーリリースに対してテストされていま
せん**。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress
で使用した場合は互換性の問題が発生する可能性があります。

![](https://s.w.org/plugins/geopattern-icon/conditional-tags-shortcode.svg)

# Conditional Tags Shortcode

 作者: [shazdeh](https://profiles.wordpress.org/shazdeh/)

[ダウンロード](https://downloads.wordpress.org/plugin/conditional-tags-shortcode.zip)

 * [詳細](https://ja.wordpress.org/plugins/conditional-tags-shortcode/#description)
 * [レビュー](https://ja.wordpress.org/plugins/conditional-tags-shortcode/#reviews)
 *  [インストール](https://ja.wordpress.org/plugins/conditional-tags-shortcode/#installation)
 * [開発](https://ja.wordpress.org/plugins/conditional-tags-shortcode/#developers)

 [サポート](https://wordpress.org/support/plugin/conditional-tags-shortcode/)

## 説明

With this shortcode you can take control of where the content is displayed.

#### Usage

You can use all the [conditional tags](https://codex.wordpress.org/Conditional_Tags)
WordPress provides. Checkout examples below.

Show text only on the homepage:
 [if is_front_page] The text [/if]

Show text only on the About page of the site:
 [if is_page=”about”] The text [/if]

Show only on the category archive view:
 [if is_category] The text [/if]

You can add “not_” before the conditional tag to reverse the logic, example:
 Show
on all pages of the site except the homepage: [if not_is_front_page] The text [/
if]

#### OR

Using multiple parameters, the content is displayed when either of the conditions
are met (“OR” comparison), for example, show text on both category and tag archive
pages:
 [if is_category is_tag] The text [/if]

#### AND

To set multiple conditions you can nest the shortcode, for example show text only
on homepage AND if the user is logged in:
 [if is_user_logged_in][if is_front_page]
The text [/if][/if]

Show a link to wordpress.org site, only on single post pages and only on mobile 
devices:
 [if wp_is_mobile][if is_single] [WordPress](https://wordpress.org/) [/
if][/if]

#### has_term_{taxonomy}

You can use this to check if the current post in the loops belongs to a custom term
in the desired taxonomy. See: https://codex.wordpress.org/Function_Reference/has_term

Example, check if current post has the “jazz” term in the “genre” taxonomy:
 [if
has_term_genre=”jazz”] The text [/if]

## インストール

 1. Upload the `menu-item-visibility` directory to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Enjoy!

## 評価

![](https://secure.gravatar.com/avatar/a790366fa6c15cb32ce4b1d394966884f896da397176b9df63af01430867f816?
s=60&d=retro&r=g)

### 󠀁[Brilliant](https://wordpress.org/support/topic/brilliant-591/)󠁿

 [Tina Hammar](https://profiles.wordpress.org/tina-hammar/) 2016年9月3日

Such a clever solution to create the code in a way that it doesn’t need to be updated
as it will accept all the conditional tags that wordpress provides. It will work
as long as wordpress don’t change their syntax …

 [ 2件のレビューをすべて表示 ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/)

## 貢献者と開発者

Conditional Tags Shortcode はオープンソースソフトウェアです。以下の人々がこのプラグ
インに貢献しています。

貢献者

 *   [ shazdeh ](https://profiles.wordpress.org/shazdeh/)

[“Conditional Tags Shortcode” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/conditional-tags-shortcode)

### 開発に興味がありますか ?

[コードを閲覧](https://plugins.trac.wordpress.org/browser/conditional-tags-shortcode/)
するか、[SVN リポジトリ](https://plugins.svn.wordpress.org/conditional-tags-shortcode/)
をチェックするか、[開発ログ](https://plugins.trac.wordpress.org/log/conditional-tags-shortcode/)
を [RSS](https://plugins.trac.wordpress.org/log/conditional-tags-shortcode/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## メタ

 *  バージョン **0.2**
 *  最終更新日 **6年前**
 *  有効インストール数 **100+**
 *  WordPress バージョン ** 3.1またはそれ以降 **
 *  検証済み最新バージョン: **5.4.19**
 *  言語
 * [English (US)](https://wordpress.org/plugins/conditional-tags-shortcode/)
 * タグ
 * [conditional](https://ja.wordpress.org/plugins/tags/conditional/)[conditional-tags](https://ja.wordpress.org/plugins/tags/conditional-tags/)
   [context](https://ja.wordpress.org/plugins/tags/context/)[page](https://ja.wordpress.org/plugins/tags/page/)
   [shortcode](https://ja.wordpress.org/plugins/tags/shortcode/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/conditional-tags-shortcode/advanced/)

## 評価

 5つ星中5つ星

 *  [  2 5-星レビュー     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=5)
 *  [  0 4-星レビュー     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=4)
 *  [  0 3-星レビュー     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=3)
 *  [  0 2-星レビュー     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=2)
 *  [  0 1-星レビュー     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/#new-post)

[すべてのレビューを見る](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/)

## 貢献者

 *   [ shazdeh ](https://profiles.wordpress.org/shazdeh/)

## サポート

意見や質問がありますか ?

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/conditional-tags-shortcode/)