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

A Long Time Ago

外掛說明

A Long Time Ago is a WordPress plugin that replaces the default post time (for example: “Posted on 01/01/2011 at 11:11”) with “Posted x time ago” (examples: “Just now”, “2 hours ago”, “Yesterday”, “on Thursday”, “3 weeks ago”, “1 year ago”).

Enjoy!

Features Include:

  • Translation-ready. Includes English, Polish and Spanish.
  • [time_ago] shortcode allowing to place the time within posts and plugins.
  • ISO-formatted <time> HTML element
  • special cases: “just now” and “yesterday”

Bonus:

  • Function improving display of weekdays when using Polish language

安裝方式

  1. Upload long-time-ago folder to the /wp-content/plugins/ directory or go to your WordPress Admin Panel -> Plugins -> Add New -> Upload (wp-admin/plugin-install.php?tab=upload)
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Use time_ago() to place the posted on date in your templates or get_time_ago() to retrieve it. You can also use the [time_ago] shortcode.

常見問題集

How do I retrieve/display the formatted date?
  • To echo the date within the theme use <?php time_ago() ?>.
  • To retrieve the date to a variable use <?php get_time_ago() ?>.
  • To display it within content or in visual editors use the [time_ago] shortcode.
How do I replace the *posted on* date format in my theme?

Various themes use different methods to display the “posted on” date.

For themes based on _s such as twentyfourteen you can replace all instances of twentyfourteen_posted_on() (names vary from theme to theme but chances are it will be called themename_posted_on()) appearing across the theme with time_ago().

You will most likely find the function in the following template files: content.php, content-single.php etc.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈A Long Time Ago〉的開發相關工作。

參與者

將〈A Long Time Ago〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

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

變更記錄

0.1

  • Initial release. Includes English, Polish and Spanish translations.