Title: single shortcode
Author: attosoft
Published: <strong>2011 年 8 月 29 日</strong>
Last modified: 2011 年 9 月 11 日

---

搜索插件

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

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

# single shortcode

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

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

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

 [支持](https://wordpress.org/support/plugin/single-shortcode/)

## 描述

Using single shortcode plugin, you can hide specified content from [excerpt](https://codex.wordpress.org/Glossary#Excerpt)
of post. The content enclosed with [single] tag is output **only** if single page
is displayed. It’s useful for hiding the following items from excerpt.

 * table of contents
 * footnotes
 * relative links, etc.

Installed this plugin, you can use the following shortcodes.

 * [single] shortcode outputs content **only** if single page is displayed
 * [excerpt] shortcode outputs content **only** if excerpt is displayed

#### Usage

Enclose content with [single] tag.

    ```
    [single] ... [/single]

    [single]
     ...
    [/single]
    ```

You can use [excerpt] tag as necessary.

    ```
    [excerpt] ... [/excerpt]

    [excerpt]
     ...
    [/excerpt]
    ```

#### Example

If you write the following code,

    ```
    <p>paragraph1</p>

    [single]
    <h5>Index</h5>
    <ul>
        <li><a href="#item1">item1</a></li>
        <li><a href="#item2">item2</a></li>
        <li><a href="#item3">item3</a></li>
    </ul>
    [/single]

    <p>paragraph2</p>
    ```

the excerpt is displayed as follows. (Index is NOT output)

> paragraph1
> paragraph2

And single page is displayed as follows. (Index is output)

> paragraph1
>  **Index**
>  * [item1](https://cn.wordpress.org/plugins/single-shortcode/?output_format=md#item1)
>  * [item2](https://cn.wordpress.org/plugins/single-shortcode/?output_format=md#item2)
>  * [item3](https://cn.wordpress.org/plugins/single-shortcode/?output_format=md#item3)
> paragraph2

#### Links

 * [Homepage (attosoft.info)](http://attosoft.info/en/) [[Japanese](http://attosoft.info/)]
 * [single shortcode Plugin Official Site](http://attosoft.info/blog/en/single-shortcode/)[
   [Japanese](http://attosoft.info/blog/single-shortcode/)]
 * ref. [Function Reference / is_single() (WordPress Codex)](https://codex.wordpress.org/Function_Reference/is_single)

## 安装

 1. Upload the plugin folder to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 常见问题

  Where is excerpt displayed?

 * Blog homepage (latest posts)
 * Archive, Category, Tag page
 * Search result
 * Posts feed (RSS/Atom)

* Please see [Glossary](https://codex.wordpress.org/Glossary#Excerpt) for more information.

## 评价

此插件暂无评价。

## 贡献者及开发者

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

贡献者

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

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

### 对开发感兴趣吗?

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

## 更新日志

#### 0.1.1

 * [excerpt] shortcode also outputs content in search results and posts feed (RSS/
   Atom)

#### 0.1

 * Initial release

## 额外信息

 *  版本 **0.1.1**
 *  最后更新：**15 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 2.5 或更高版本 **
 *  已测试的最高版本为 **3.2.1**
 *  语言
 * [English (US)](https://wordpress.org/plugins/single-shortcode/)
 * 标签
 * [excerpt](https://cn.wordpress.org/plugins/tags/excerpt/)[hide](https://cn.wordpress.org/plugins/tags/hide/)
   [shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)[single page](https://cn.wordpress.org/plugins/tags/single-page/)
   [Single post](https://cn.wordpress.org/plugins/tags/single-post/)
 *  [高级视图](https://cn.wordpress.org/plugins/single-shortcode/advanced/)

## 评级

尚未提交反馈。

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

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

## 贡献者

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

## 支持

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

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