這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

SortTable Post

外掛說明

Ever want to list your WordPress posts in an easy-to-read, sortable data table? This plugin makes it easy to do just that. It supports post thumbnails, custom post types, custom taxonomies, and (as of v4.0) custom fields.

By default, the plugin outputs the following columns:

  1. Post Thumbnail (if enabled)
  2. Post Title
  3. Post Date
  4. Post Categories
  5. Post Tags

Options include:

  • Omit any of the default columns
  • Replace Post with a custom post type
  • Replace Categories and Tags with custom taxonomies
  • As of version 4.0 you can insert any number of custom field columns

How To Use

[sorttablepost]

Place this shortcode into a post or page to insert a sortable table of all posts.

Hide Standard Columns

[sorttablepost nothumb="true" notitle="true" nodate="true" nocats="true" notags="true"]

You can omit any undesired columns by using one or more of these shortcode options.

Show Custom Post Type

[sorttablepost type="my-custom-post-type"]

You can specify the name of a custom post type (or page), instead of showing posts.

Use Custom Taxonomies

[sorttablepost cat="my-custom-taxonomy" tag="another-custom-taxonomy"]

You can replace the standard Categories or Tags columns (or both) with custom taxonomies.

Use Custom Fields

[sorttablepost meta="Custom Field Key,Another Custom Field Key,Yet Another"]

As of v4.0, you can add as many custom field columns as you like. Use a comma-seperated list of field keys.

Assign Unique ID to Table

[sorttablepost id="mytable"]

As of v4.2, you can give each table a unique ID. This is particularly useful when displaying multiple tables on the same page, as it allows you to style each one differently.

About This Plugin

For more information about this plugin, visit: http://mynewsitepreview.com/sorttablepost/

To see a live demo, visit: http://mynewsitepreview.com/sorttablepost-wordpress-plugin-live-demo

About SortTable.js

The sortable table portion of this plugin is made possible by Stuart Langridge’s awesome Javascript library.

Documentation for sorttable.js can be found at: http://www.kryogenix.org/code/browser/sorttable/

安裝方式

  1. Upload the entire folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Insert the shortcode [sorttablepost] in any post or page

常見問題集

How do I style my sortable tables?

I know, I know. The default colors look pretty nasty in most themes. Also, you may want to style individual columns. Below is the code I used to change the default colors to match my theme on the live demo seen here: http://mynewsitepreview.com/sorttablepost-wordpress-plugin-live-demo

You can add similar code to your theme’s style.css:

/* Header Row Colors */
table.sortable thead tr {
    background-color: #71a7c8 !important;
    color: #fff !important;
}

/*  Highlight Color for Header Row Cells on Hover*/
table.sortable th:hover:not(.sorttable_nosort) {
    background: #b3d0e1 !important;
}

/* Shading For Even Rows */
table.sortable tr:nth-child(even) { background: #f6f6f6 !important; }

/* Table Border Color */
table.sortable th,
table.sortable td {
    border: 1px solid #71a7c8 !important;
}

/*  Style & Width of Particular Columns */
table.sortable td.col3,
table.sortable td.col4,
table.sortable td.col5,
table.sortable td.col6,
table.sortable td.col7 {
    text-align: center !important;
    width: 10% !important;
}

使用者評論

2016 年 9 月 3 日
Okay, it's not really four stars. But there's no other plugin with function like this. And this plugin still work with some patch. Just go to the Support Forum Section to solve the problem that you might encounter. PS: Author, we need you here 🙂
閱讀全部 3 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈SortTable Post〉的開發相關工作。

參與者

將 SortTable Post 外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

4.2

  • Added function to convert links and email addresses contained in custom field values into HTML links.
  • Added option to assign a unique ID to the table.

4.1

  • Added option to include a Post Excerpt column.
  • Cleaned up code by grouping variable initializations.

4.0

  • Added option to omit the Title column.
  • Added support for custom field columns.
  • Made hide-column shortcode options work regardless of singular or plural (e.g. nothumb="true" works the same as nothumbs="true").

3.0

  • Added options to omit the Thumbnail, Date, and Category columns.
  • Cleaned up code for human readability.

2.0

  • Added support for custom taxonomies.
  • Added option to omit the Tags column.

1.0

  • First public release.