Linux 软件免费装

A Long Time Ago

开发者 amielucha
更新时间 2014年1月24日 04:08
PHP版本: 3.0.1 及以上
WordPress版本: 3.8
版权: GPLv2 or later
版权网址: 版权信息

标签

time timestamp date yesterday weekdays days of the week today time ago timestamp shortcode ago minutes now fuzzy date hours ago Polish Polski dni tygodnia

下载

详情介绍:

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: Bonus:

安装:

  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.

更新日志:

0.1