Title: Conditional Tags Shortcode
Author: shazdeh
Published: <strong>28 ມັງກອນ 2015</strong>
Last modified: 26 ພຶດສະພາ 2020

---

ຄົ້ນຫາປລັກອິນ

ປລັກອິນນີ້ **ຍັງບໍ່ທັນໄດ້ຮັບການທົດສອບກັບ 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://lo.wordpress.org/plugins/conditional-tags-shortcode/#description)
 * [ການຣີວິວ](https://lo.wordpress.org/plugins/conditional-tags-shortcode/#reviews)
 *  [ການຕິດຕັ້ງ](https://lo.wordpress.org/plugins/conditional-tags-shortcode/#installation)
 * [ການພັດທະນາ](https://lo.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/) 3 ກັນຍາ 2016

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” ແມ່ນຊອຟແວໂອເພັນຊອດ (Open Source). ບຸກຄົນຕໍ່ໄປນີ້ໄດ້
ມີສ່ວນຮ່ວມໃນການພັດທະນາປລັກອິນນີ້.

ຜູ້ຮ່ວມພັດທະນາ

 *   [ 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).

## ຂໍ້ມູນກຳກັບ (Meta)

 *  ເວີຊັນ **0.2**
 *  ອັບເດດຫຼ້າສຸດເມື່ອ **6 ປີ ທີ່ຜ່ານມາ** ທີ່ຜ່ານມາ
 *  ການຕິດຕັ້ງທີ່ໃຊ້ງານຢູ່ **100+**
 *  ເວີຊັນ WordPress ** 3.1 ຫຼື ສູງກວ່າ **
 *  ທົດສອບເຖິງເວີຊັນ **5.4.21**
 *  ພາສາ
 * [English (US)](https://wordpress.org/plugins/conditional-tags-shortcode/)
 * ແທັກ
 * [conditional](https://lo.wordpress.org/plugins/tags/conditional/)[conditional-tags](https://lo.wordpress.org/plugins/tags/conditional-tags/)
   [context](https://lo.wordpress.org/plugins/tags/context/)[page](https://lo.wordpress.org/plugins/tags/page/)
   [shortcode](https://lo.wordpress.org/plugins/tags/shortcode/)
 *  [ມຸມມອງຂັ້ນສູງ](https://lo.wordpress.org/plugins/conditional-tags-shortcode/advanced/)

## ການໃຫ້ຄະແນນ

 5 ຈາກທັງໝົດ 5 ດາວ.

 *  [  ການວິຈານ 5 ດາວ ຈຳນວນ 2 ລາຍການ     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=5)
 *  [  ການວິຈານ 4 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=4)
 *  [  ການວິຈານ 3 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=3)
 *  [  ການວິຈານ 2 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=2)
 *  [  ການວິຈານ 1 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/conditional-tags-shortcode/reviews/?filter=1)

[ການທົບທວນຂອງທ່ານ](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/)