Title: Logic Shortcodes
Author: Samuel Diethelm
Published: <strong>2016 年 4 月 19 日</strong>
Last modified: 2016 年 4 月 28 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/logic-shortcodes.svg)

# Logic Shortcodes

 作者：[Samuel Diethelm](https://profiles.wordpress.org/samueldiethelm/)

[下载](https://downloads.wordpress.org/plugin/logic-shortcodes.zip)

 * [详情](https://cn.wordpress.org/plugins/logic-shortcodes/#description)
 * [评价](https://cn.wordpress.org/plugins/logic-shortcodes/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/logic-shortcodes/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/logic-shortcodes/#developers)

 [支持](https://wordpress.org/support/plugin/logic-shortcodes/)

## 描述

This plugin enables the use of [if] shortcodes to work with conditional logic based
on the existence of post meta or taxonomy terms on posts and pages.

Please consider taking a minute to rate the plugin or let me know any feature request.
Thanks!

#### Taxonomy

With conditional logic for taxonomy terms, you can use names, slugs or term_ids:

 * [if taxonomy=”category” slug=”cars”]Content to show[/if]
 * [if taxonomy=”category” name=”Cars”]Content to show[/if]
 * [if taxonomy=”category” id=”123″]Content to show[/if]

#### Post Meta

Post meta (or custom field) logic can be used to check if a certain meta_key AND
meta_value combination are present or just a meta_key:

 * [if postmeta=”car_model”]Content to show if car model info is present[/if]
 * [if postmeta=”car_model” value=”Tesla Model S”]Content to show if car model is
   Tesla Model S[/if]

## 安装

 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the
    plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress

## 常见问题

  Where can I use the logic?

Anywhere where shortcodes are accepted and a post or page is being displayed.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Logic Shortcodes」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Samuel Diethelm ](https://profiles.wordpress.org/samueldiethelm/)

[帮助将「Logic Shortcodes」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/logic-shortcodes)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/logic-shortcodes/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/logic-shortcodes/)，或通过[RSS](https://plugins.trac.wordpress.org/log/logic-shortcodes/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/logic-shortcodes/)。

## 更新日志

#### 1.0

 * Initial upload

## 额外信息

 *  版本 **1.0**
 *  最后更新：**10 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 2.5.0 或更高版本 **
 *  已测试的最高版本为 **5.4.19**
 *  语言
 * [English (US)](https://wordpress.org/plugins/logic-shortcodes/)
 * 标签
 * [conditional](https://cn.wordpress.org/plugins/tags/conditional/)[logic](https://cn.wordpress.org/plugins/tags/logic/)
   [postmeta](https://cn.wordpress.org/plugins/tags/postmeta/)[taxonomy](https://cn.wordpress.org/plugins/tags/taxonomy/)
   [term](https://cn.wordpress.org/plugins/tags/term/)
 *  [高级视图](https://cn.wordpress.org/plugins/logic-shortcodes/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/logic-shortcodes/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/logic-shortcodes/reviews/)

## 贡献者

 *   [ Samuel Diethelm ](https://profiles.wordpress.org/samueldiethelm/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/logic-shortcodes/)