| 开发者 | amielucha |
|---|---|
| 更新时间 | 2014年1月24日 04:08 |
| PHP版本: | 3.0.1 及以上 |
| WordPress版本: | 3.8 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[time_ago] shortcode allowing to place the time within posts and plugins.<time> HTML elementlong-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)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.<?php time_ago() ?>.<?php get_time_ago() ?>.[time_ago] shortcode.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.