Title: Category Shortcode
Author: robertdrake
Published: <strong>2010 年 3 月 3 日</strong>
Last modified: 2010 年 10 月 15 日

---

搜索插件

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

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

# Category Shortcode

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

[下载](https://downloads.wordpress.org/plugin/category-shortcode-w-generator.1.3.zip)

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

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

## 描述

This plugin creates the [Category]] Shortcode. The code takes 5 arguments:

number: the number of posts to display. 0 equals the default number. -1 equals the
total available.

Order: Ascending or Descending

Display Method: Full, Excerpt, Title

Order By: Author, Date, Title, Modified, Parent, ID, Rand, None, or Comment Count.

Category: this is the category id the category or categories that should be searched.
Multiple categories can be specified in a comma separated list.

Example shortcode:

[Category number=’5′ method=’title’ order=’asc’ id=’11,45′ orderby=’comment_count’]

This will show 5 posts in ascending order of category 11 and 45 as arranged by comment_count
and will display just the post titles.

### Acknowledgements

A big thank you to g33kg0dd3ss for figuring out the 1.3 fix issue with the loop 
being broken. She contributed the patch fix.

### Future Additions?

 1.  Let plugin form allow for multiple category selections
 2.  Let plugin form allow for multiple orderby methods
 3.  In admin form restrict Number of posts to numbers only.
 4.  In admin form setup a copy and paste script
 5.  Accept a category name as a valid input
 6.  Internationalization of the plugin
 7.  Improve Formatting of Posts / Make formatting easier to edit./ Give user more 
     control over formatting
 8.  Allow attachments to come through
 9.  Turn title links on or off.
 10. Allow comments in output
 11. Give user more control over the postformatting
 12. Add ability to modify thumbnail options through shortcode

## 安装

 1. Upload the `category_shortcode` directory to the `/wp-content/plugins` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Place a valid [Category] code into a page.

## 常见问题

  How do I create a valid category tag?

A tool has been provided under the tools menu (Category Shortcode). Use this generate
valid tags. Note: the tool cannot be used to generate a tag that displays multiple
categories, but the shortcode does support this.

  How do I style the output?

I’ve made div classes around the content data. These classes are:
 csc_post_thumbnail
csc_post_title csc_post_date csc_post_author csc_post_category csc_post_excerpt 
csc_post_content csc_break (a div between each post)

There is also a style div around the entire post with a class of csc_post and then
either csc_excerpt, full or title to help with styling.
 csc_post csc_excerpt csc_title
csc_full

An example style to modify the size of the title would be

.csc_post_title {
 font-size: 14px; }

These properties can be set to display: none; to hide the data. More advanced styling
could be done modifying the php in the section commented OUTPUT STYLING.

## 评价

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

### 󠀁[Seems like a Nice Plugin](https://wordpress.org/support/topic/seems-like-a-nice-plugin-1/)󠁿

 [Jay](https://profiles.wordpress.org/darthdocgmailcom/) 2016 年 9 月 3 日

Seems to work well and easily. Super easy to get the short code. (through Tools 
menu) Add some styling to the elements and your done.

 [ 阅读所有2条评价 ](https://wordpress.org/support/plugin/category-shortcode-w-generator/reviews/)

## 贡献者及开发者

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

贡献者

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

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

### 对开发感兴趣吗?

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

## 更新日志

#### 1.0

 * Plugin introduced into the wild.

#### 1.1

 * Fixed bug where content was floating to the top of the page
 * Changed some formatting

#### 1.2

 * NOTICE TO THOSE UPDATING — this release may change how the visual output because
   html tags will no longer be stripped out of the full post or excerpt output. 
   Be aware.
 * The Get_Content function strips out tags. I’ve tweaked the code so tags are retained
   in the excerpt and full output styles
 * Added post thumbnail to the excerpt and title output with the csc_post_thumbnail
   css class
 * Expanded explanation of CSS Styling

#### 1.3

 * Fixed an issue where the loop was being broken on the host page (where the shortcode
   lived) and showing the shortcode’s last post instead.
 * Placed a DIv around the entire posting to make styling easier.

## 额外信息

 *  版本 **1.3**
 *  最后更新：**16 年前**
 *  活跃安装数量 **300+**
 *  WordPress 版本 ** 2.9.0 或更高版本 **
 *  已测试的最高版本为 **3.0.5**
 *  语言
 * [English (US)](https://wordpress.org/plugins/category-shortcode-w-generator/)
 * 标签
 * [category](https://cn.wordpress.org/plugins/tags/category/)[shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)
 *  [高级视图](https://cn.wordpress.org/plugins/category-shortcode-w-generator/advanced/)

## 评级

 4 星（最高 5 星）。

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

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

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

## 贡献者

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

## 支持

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

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

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://robertdrake.net)