前言介紹
- 這款 WordPress 外掛「WP Date and Time Shortcode」是 2019-09-16 上架。
- 目前有 10000 個安裝啟用數。
- 上一次更新是 2025-04-16,距離現在已有 17 天。
- 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
- 有 28 人給過評分。
- 論壇上目前有 2 個提問,問題解答率 100% ,不低,算是個很有心解決問題的開發者團隊了!
外掛協作開發者
外掛標籤
date | time | wpdts | shortcode | shortcodes |
內容簡介
顯示當前、過去和未來日期或時間的簡碼。在您的文章和頁面中顯示今年、上一年、下一年、月份、日期等等。
這可能是您網站所需的最後一個日期和時間簡碼插件,因為它非常豐富的功能。
開發和支援插件需要大量的努力。在給出差評之前,請向我們發送您的反饋和問題以解決您的問題。
您使用此插件是否滿意? 請考慮留下五星評論。您也可以捐贈。
如果您需要支持或更多有關此免費插件的信息,請閱讀下面的描述和常見問題解答部分的說明,或在支持論壇中發表。
它如何運作?
只需將以下其中一個簡碼放入您的文章或頁面中,它們將開箱即用。如果您需要更詳細的功能,請使用屬性。如果您需要將簡碼用於其他地方(例如標題、導航菜單、頁腳、小工具等),如果它們不被默認支援,您可能需要額外的代碼或插件來啟用它們在您的佈景主題中。
[wpdts] – 主要簡碼,可使用所有屬性;默認等同於[wpdts-date-time];
[wpdts-date-time] – 從 WordPress 一般設置中的默認日期和時間格式
[wpdts-date] – 從 WordPress 一般設置中的默認日期格式
[wpdts-time] – 從 WordPress 一般設置中的默認時間格式
[wpdts-custom]– 使用 PHP 日期和時間格式字符的自定義格式
[wpdts-years], [wpdts-year] – 4位數年份,例如1999或2134
[wpdts-year-short] – 2位數年份,例如99或34
[wpdts-months], [wpdts-month] – 月份,數字形式 (1-12)
[wpdts-month-name]– 月份,全名 (January-December)
[wpdts-month-name-short] – 月份,3個字母簡稱 (Jan-Dec)
[wpdts-days], [wpdts-day] – 日期 (1-31)
[wpdts-hours], [wpdts-hour] – 小時 (0-24)
[wpdts-minutes], [wpdts-minute] – 分鐘 (0-60)
[wpdts-seconds], [wpdts-second] – 秒數 (0-60)
[wpdts-day-of-year] – 全年中的日期數字 (1-366)
[wpdts-days-in-month] – 月份的天數 (28-31)
[wpdts-days-in-february] – 年份中2月份的天數 (28-29)
[wpdts-days-in-year] – 全年的天數 (365或366)
[wpdts-weekday]– 星期幾的數字形式 (1-7)
[wpdts-weekday-name]– 星期幾的全名 (Monday-Sunday)
[wpdts-weekday-name-short] – 星期幾的簡略3字母名稱 (Mon-Sun)
[wpdts-week-of-year] – 全年的星期,自年初的第一個周一開始 (1-52)
[wpdts-am-pm]– 根據 am_pm 屬性顯示 am / pm 或 AM / PM(“L”或“U”)
使用示例和自定義屬性示例
如果您需要查看實時使用示例或設置自定義屬性,請參閱以下示例:
原文外掛簡介
Shortcode to show any current, past, and future date or time. Display this, previous, or next year, month, day, etc. in your posts and pages.
This is probably the last date and time shortcode plugin you will ever need for your websites since it is very rich in features.
It takes lots of efforts to develop and support a plugin. Please send us your feedback and questions to fix your issue before leaving a bad review.
Are you satisfied by using this plugin? Consider leaving a 5 star review. You can also donate.
If you need support or more information about this free plugin please read the description and the F.A.Q. section below or write in the Support Forum.
How it works?
Just put one of these shortcodes in your post or page content and they will work out of the box.
[wpdts] – the main shortcode which works with all attributes; equals to [wpdts-date-time] by default;
[wpdts-date-time] – default date and time format from WordPress general settings
[wpdts-date] – default date format from WordPress general settings
[wpdts-time] – default time format from WordPress general settings
[wpdts-custom]– custom format using the PHP date and time formatting characters
[wpdts-years], [wpdts-year] – 4-digit year e.g. 1999 or 2134
[wpdts-year-short] – 2-digit year e.g. 99 or 34
[wpdts-months], [wpdts-month] – month as number (1-12)
[wpdts-month-name]– month as name (January-December)
[wpdts-month-name-short] – month as 3-letter name (Jan-Dec)
[wpdts-days], [wpdts-day] – day of month (1-31)
[wpdts-hours], [wpdts-hour] – hours (0-24)
[wpdts-minutes], [wpdts-minute] – minutes (0-60)
[wpdts-seconds], [wpdts-second] – seconds (0-60)
[wpdts-timestamp] – Unix timestamp
[wpdts-day-of-year] – day of the year as number (1-366)
[wpdts-days-in-month] – number of days in the month (28-31)
[wpdts-days-in-february] – number of days in the month of February for the year (28-29)
[wpdts-days-in-year] – number of days in the year (365 or 366)
[wpdts-day-of-week]– day of the week as number (1-7)
[wpdts-day-of-week-name]– day of the week as full name (Monday-Sunday)
[wpdts-day-of-week-name-short] – day of the week as short 3-letter name (Mon-Sun)
[wpdts-week-of-year] – week of year, since first Monday of the year (1-52)
[wpdts-am-pm]– am/pm or AM/PM according to the am_pm attribute (“L” or “U”)
[wpdts-time-zone]– the current time-zone for the shortcode result
If you need to use the shortcodes in other places (like titles, navigation menus, footers, widgets, etc.) additional code or plugins may be needed to turn them on in your theme if they are not supported by default. See F.A.Q. section for details.
EXAMPLES
If you need to view real-time examples of usage or set up custom attributes to show specific date or time please see the page of WP Date and Time Shortcode on Denra.com.
ATTRIBUTES
If you need more detailed features please use the shortcode attributes.
Features
Show date and/or time in the default WordPress formats.
Show date and/or time in custom format based on the PHP date and time formatting characters
Show date and/or time based on fixed SQL/date/time format or any relative date and time format. See the Relative Formats section.
Show year separately as 4 or 2-digit number (e.g. 1999 or 99).
Show month as number (1-12), full name (January-December) or 3-letter name (Jan-Dec).
Show day as number with or without leading zero, with or without suffix (st, nd, rd, th).
Show hour, minutes, seconds with or without leading zero.
Show day of week as number (1-7), full name (Monday-Sunday) or three letters (Mon-Sun).
Show the day of the year (1-366).
Show the number of days for the month (28-31).
Show the number of days in February for the year (28 or 29).
Show the day of the year (365 or 366).
Show the week of the year (1-52).
Show currently used time-zone.
Show the first day from a list of next coming weekdays, days of month, or the last day of the current month.
Add or subtract years, months, days, hours, minutes and/or seconds before showing the final result.
Set post/page creation or modification time (including GMT variants) as “init” attribute.
Attributes and values
You can add the following attributes to [wpdts] to show the date and time that you need:
item – what date and time information to show. The used values are:
date-time – default WP date and time format (default value)
custom – custom format using the PHP date and time formatting characters
date – default WP date format
time – default WP time format
year, years – 4-digit year
year-short, years-short – 2-digit year
month, months – month as number (1-12)
month-name – month as name (January-December)
month-name-short – month as 3-letter name (Jan-Dec)
day, days – day of month (1-31)
hour, hours – hours (0-24)
minute, minutes – minutes (0-60)
second, seconds – seconds (0-60)
timestamp – Unix timestamp
day-of-year – day of the year as number (1-366)
days-in-month – number of days in the month (28-31)
days-in-february – number of days in the month of February for the year (28-29)
day-of-week – day of the week as number (1-7)
day-of-week-name – day of the week as full name (Monday-Sunday)
day-of-week-name-short – day of the week as short 3-letter name (Mon-Sun)
week-of-year – week of year, since first Monday of the year (1-52)
am-pm – am/pm or AM/PM according to the am_pm attribute (“L” or “U”)
time-zone – the current time-zone for the shortcode result
format – date format used with the PHP date and time formatting characters only when item is set to custom
start – set the basic date and time for the shortcode; defaults to the WordPress time in the current timezone.
initial date and/or time string based on fixed SQL/date/time formats (e.g. 2019-09-16 17:45:53 or Sep 16, 2019 17:45:53) or any relative date and time format. See the Relative Formats section.
now – the default initial current date and time based on the WordPress General settings time-zone
post-created – gets the post/page creation date and time
post-created-gmt – gets the post/page creation date and time GMT
post-modified – gets the post/page last modification date and time
post-modified-gmt – gets the post/page last modification date and time GMT
next – move the start date and time to the next coming selected (can have more than one value separated by comma)
mon, tue, wed, thu, fri, sat, sun – weekday shortname (and with first letter in uppercase)
1–31 – day of month
last-day-of-month – the last day of month – 28, 29, 30, or 31
time_zone – select the time-zone for which to display the result from the available PHP time-zones.
i18n – set months and weeks names to be displayed in the current language (‘yes’ by default)
days_suffix – set suffix st, nd, rd, th for the day and days item e.g. 1st, 2nd, 3rd, 4th, etc.
hours_24 – set 12 or 24 hours format for the hours item.
am_pm – used with the am-pm item when 12 hours format is preferred: “L” for lowercase (am, pm) or “U” for uppercase (AM, PM)
post_id – post ID from which to get post-created(-gmt) or post-modified(-gmt)
years – change in years e.g. years="+1" or years="-1" before showing
months – change in months e.g. months="+2" or months="-2" before showing
days – change in days e.g. days="+7" or days="-7" before showing
hours – change in hours e.g. hours="+12" or hours="-12" before showing
minutes, minutes_change – change in minutes e.g. minutes="+30" or minutes="-30" before showing
seconds, seconds_change – change in seconds e.g. seconds="+45" or seconds="-45" before showing
zero – show leading zero when months, days, hours, minutes and seconds are displayed. Old ones ‘x-zero’ for each separate item are still supported for compatibility.
(COMING ASAP) 3.0 PRO EDITION with an annual subscription plan
WP Date and Time Shortcode is fully FREE and contains all main features that are needed by most users. Check them out!
However, since we want to continue supporting this plugin and adding new non-basic features, we have decided to offer a Pro edition with an annual subscription plan offered at a very affordable price per website. We are working hard to release the Pro edition although it took us a little bit more time to prepare it than expected in the beginnig.
What will you get with WP Date and Time Shortcode Pro in the near future?
Technical support by email and Facebook Messenger chat on our website. The free version will be supported by the Support Forum only.
JavaScript display of the shortcode result even on cached pages. You won’t need to turn off the caching for any page and post!
Additional pre-defined date and time initialization values like:
First visit on the website (saved as cookie, session and user option if possible)
Last visit on the website (saved as cookie, session and user option if possible)
Catholic and Orthodox Easter dates
Passover
Hanukkah
Mother’s day
Father’s day
Columbus day
Thanksgiving day
Black Friday
Cyber Monday
Christmas
New year
Chinese new year
and more.
Additional items and attributes:
style – change font face, color and size;
time-zone browser/IP parameter – modify the shortcode result to the visitor’s timezone (not 100% accurate since it gets the timezone by IP address);
counter – dynamically change displayed values as a ticking text clock;
Shortcode Wizard – create shortcodes using an easy to use step-by-step wizard.
Menu Location – change the menu display – main admin menu, settings menu, top menu, or turn off all.
And more.
IMPORTANT NOTE: Not all Pro features will be released in the first Pro version since more work and testing is needed for some of them.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP Date and Time Shortcode」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
2.6.6 | 2.6.7 | 2.6.8 | 2.6.9 | trunk |
延伸相關外掛(你可能也想知道)
WP Maximum Execution Time Exceeded 》, 注意:請先閱讀安裝說明。WP Maximum Execution Time Exceeded外掛需要您進行網站備份程序。, , WP Maximum Execution Time Exceeded是一個非常簡單且有效...。
Reading Time WP 》WP Reading Time 讓你輕鬆地在 WordPress 文章中加入預估閱讀時間。啟用這個外掛會自動在你的文章內容的開始加入閱讀時間。你可以在「閱讀時間」設定中取消這...。
Show/Hide Content at Set Time 》喜歡這個外掛嗎?請考慮留下評論或寫下你在網站上使用它的經驗–如果你這樣做,請給我一個連結。, 這個外掛在 GitHub 維護,歡迎使用存儲庫報告問題,提...。
Meks Time Ago 》Meks Time Ago WordPress 外掛讓您可以輕鬆將文章日期顯示改為「多久以前」的格式,例如「1小時前」、「2週前」、「5個月前」、「4天前」等,同時提供多種選...。
Bulk Datetime Change 》可批量變更文章的日期/時間。, 可變更的物件, , 文章。, 頁面。, 媒體檔案。, , 日期/時間選擇器, , 可使用 DateTimePicker,一款 jQuery 外掛,選擇日期/時...。
Waiting: One-click countdowns 》一鍵倒數計時。, 倒數計時到一個日期或特定持續時間(例如從頁面加載開始的 60 秒)。, 功能:, , 無限的倒數計時。, 易於使用的可視化構建器,具有實時預覽...。
Seed Buddhist Year 》Seed Buddhist Year可以將輸出的年份改為佛曆或佛教紀元(BE),但不會影響使用基督教/西曆(CE)的微格式。, 只需安裝插件,即可覆蓋以下功能:, , get_the_...。
Limit Modified Date 》警告:此外掛已不再受支援,可能無法與古騰堡區塊編輯器兼容。, 我建議改用 Change Last Modified Date 外掛。, 概要, 當對內容進行輕微更改時,避免修改日期...。
The Future Is Now 》這是一個 WordPress 外掛,主要針對活動網站,您可以設定文章在未來的時間點上線,但是它會立即顯示 (預設情況下,WordPress 不會顯示未來時間戳記的文章,直...。
WP Time Slots Booking Form 》WP Time Slots Booking Form 可以建立預約表單,讓客戶預約日曆日期中的時段。基本上,您可以創建一個表單,包含一個日曆,讓最終使用者選擇日曆日期中的時間...。
WP-Farsi 》WordPress 外掛:公曆轉陰曆日期轉換器, , 完整的日期和數字轉換器, 當您未安裝波斯語言時,可支援安裝波斯語言介面, 將英文數字轉換為波斯語數字, 修正主機...。
Reading Position Indicator 》創建一個垂直進度條,顯示目前單一文章的滾動進度。, 感謝Pankaj Parashar在 CSS-TRICKS 上撰寫有關閱讀位置指示器的文章(Reading Position Indicator)。
Last Updated Shortcode 》建立 [lastupdated] 短碼,以顯示文章或頁面的最後更新日期和/或時間。如果不帶任何參數使用,它將使用在「設定」>「一般」選項設定的日期格式來顯示。它支援...。
Date Time Field Add-On for Gravity Form 》Gravity Forms 的日期時間外掛,具備自訂日期時間格式功能:, , 此外掛將在「進階欄位」下新增「日期時間」欄位類型。, 只需將「日期時間」欄位拖曳至表單中...。
Date and Time Widget 》這個「日期及時間小工具」讓您可以在側邊欄中加入一個小工具,顯示當地日期和/或時間。, 特色, , 可以選擇日期和時間的格式。, 自訂字型、字型大小、文字顏色...。