Title: Template Part Shortcode
Author: Marty Spellerberg
Published: <strong>2012 年 11 月 9 日</strong>
Last modified: 2012 年 11 月 9 日

---

搜索插件

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

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

# Template Part Shortcode

 作者：[Marty Spellerberg](https://profiles.wordpress.org/martyspellerberg/)

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

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

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

## 描述

Template parts are reusable snippets of code stored in your theme directory. Normally,
they are called by other template files using the get_template_part() function. 
This plugin creates a shortcode for calling template parts from the body of a post.

Shortcode usage is: [template part=”somepart”].

Template parts must be stored in a “parts” folder within your theme directory.

If you use custom loops in your template parts, remember to use “reset_query” at
the end to return the page to normal.

## 安装

 1. Install and activate the plugin, in the normal way;
 2. In your theme directory, create a subfolder called “parts”;
 3. Create your template part and save it into the “parts” directory — ie. parts/somepart.
    php;
 4. In your post Content, call the part via [template part=”somepart”]

That’s it!

## 评价

此插件暂无评价。

## 贡献者及开发者

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

贡献者

 *   [ Marty Spellerberg ](https://profiles.wordpress.org/martyspellerberg/)

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

### 对开发感兴趣吗?

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

## 额外信息

 *  版本 **0.1**
 *  最后更新：**14 年前**
 *  活跃安装数量 **100+**
 *  WordPress 版本 ** 3.4 或更高版本 **
 *  已测试的最高版本为 **3.4.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/template-part-shortcode/)
 * 标签
 * [shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)[template parts](https://cn.wordpress.org/plugins/tags/template-parts/)
   [templates](https://cn.wordpress.org/plugins/tags/templates/)
 *  [高级视图](https://cn.wordpress.org/plugins/template-part-shortcode/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/template-part-shortcode/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/template-part-shortcode/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/template-part-shortcode/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/template-part-shortcode/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/template-part-shortcode/reviews/?filter=1)

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

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

## 贡献者

 *   [ Marty Spellerberg ](https://profiles.wordpress.org/martyspellerberg/)

## 支持

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

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