前言介紹
- 這款 WordPress 外掛「Current Year Shortcode」是 2025-03-31 上架。
- 目前有 20 個安裝啟用數。
- 上一次更新是 2025-04-01,距離現在已有 33 天。
- 外掛最低要求 WordPress 6.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
date | year | copyright | shortcode | dynamic content |
內容簡介
**總結:**
這是一個外掛程式,可添加簡單的短代碼以顯示當前年份或動態年份範圍,在網站底部特別適用於版權聲明。使用 [year] 來顯示當前年份,若提供起始年份,則會顯示日期範圍。亦可使用 [runthings_year] 作為自動後備代碼。
**問題與答案:**
1. 這個外掛的最基本用法是什麼?
- 答:使用 [year] 來顯示當前年份,若提供起始年份,則顯示該年份至當前年份的日期範圍。
2. 如何在外掛中創建動態年份範圍?
- 答:使用 [year from="2020"] 來創建動態年份範圍。
3. 如何在簡短格式中顯示年份範圍?
- 答:使用 [year from="2020" mode="short"] 來顯示簡短的年份範圍,例如 "2020-25"(如果當前年份為2025)。
4. 如果其他外掛已經使用了 [year] 這個短代碼,這個外掛會怎麼處理?
- 答:使用預設的後備短代碼 [runthings_year] 來替代,並可以透過 runthings_current_year_shortcode_tag 過濾器進行自訂設定。
5. 關於過濾器 runthings_current_year_shortcode_tag,它的主要功能是什麼?
- 答:此過濾器允許自定義外掛使用的短代碼標籤。
詳細文檔和例子可在 GitHub 上查看。
原文外掛簡介
This is a plugin which adds a simple shortcode to display the current year or a dynamic year range, particularly useful for copyright statements at the bottom of your website.
Its most basic usage is [year], which will display the current year. If you provide a starting year with the ‘from’ parameter, it will expand into a date range when the ‘from’ year is before the current year.
If [year] is used by another plugin, then it uses the fallback [runthings_year] which can be customised with the runthings_current_year_shortcode_tag filter. You can see the active shortcode tag in it entry in the installed plugins page.
Features
Display current year with [year]
Create a dynamic year range with [year from="2020"]
Abbreviated year format with [year from="2020" mode="short"], which shows “2020-25” (if the current year is 2025)
Automatic fallback shortcode [runthings_year] if another plugin already uses the ‘year’ shortcode
Filter (runthings_current_year_shortcode_tag) to set your own shortcode
Usage Examples
Assuming the current year is 2025:
[year] displays “2025”
[year from="2025"] displays “2025” (since it’s the current year)
[year from="1983"] displays “1983-2025”
[year from="2020" mode="short"] displays “2020-25” (shortened current year)
[year from="1995" mode="short"] displays “1995-2025” (not shortened because centuries differ)
Filters
runthings_current_year_shortcode_tag
This filter allows customization of the shortcode tag used by the plugin.
For detailed documentation and examples, see the full documentation on GitHub.
Parameters:
$tag (string): The shortcode tag to be registered. Defaults to ‘year’ or ‘runthings_year’ if conflicted.
Additional Notes
Built by Matthew Harris of runthings.dev, copyright 2021-2025.
Visit runthings.dev for more WordPress plugins and resources.
Contribute or report issues at GitHub repository.
License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/gpl-3.0.html.
Icon – Calendar by Qadeer Hussain, from Noun Project, https://thenounproject.com/browse/icons/term/calendar/ (CC BY 3.0)
Icon – legal by hanis tusiyani, from Noun Project, https://thenounproject.com/browse/icons/term/legal/ (CC BY 3.0)
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Current Year Shortcode」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Parsi Date 》這個外掛是由波斯語開發人員開發,旨在為波斯語 WordPress 帶來更好的使用體驗。它包括了太陽曆(Jalali)日曆、字符問題修復和 WordPress 後臺環境的從右到...。
WP Meta and Date Remover 》移除點擊文章的Meta、作者和日期。 安裝、啟用,完成!, 如何移除文章和頁面的作者Meta和日期?, , 安裝 WP Meta and Date remover。, 啟用外掛。, 選擇隱藏...。
Hide/Remove Metadata 》Hide/Remove Metadata是一款免費、簡單而非常實用的WordPress外掛,能夠幫助您輕鬆地隱藏或刪除網站上的作者和發布日期。該外掛非常容易使用,僅提供隱藏或移...。
WP-Persian 》WP-Persian 是一款快速強大的 WordPress 插件,可提供 Jalali 月曆和波斯語言支援,並支援標準插件。, , 如果您喜歡這款插件,請隨時在這個頁面的右側評分!,...。
WP Date and Time Shortcode 》顯示當前、過去和未來日期或時間的簡碼。在您的文章和頁面中顯示今年、上一年、下一年、月份、日期等等。, 這可能是您網站所需的最後一個日期和時間簡碼插件...。
WP Author, Date and Meta Remover 》即時自訂或刪除您的元數據!WP 作者、日期和元數據移除 Pro+現已上市。WP ADMR Pro+ for Intelligent Meta Data Control。, WordPress 已成為許多線上企業主...。
Show/Hide Content at Set Time 》喜歡這個外掛嗎?請考慮留下評論或寫下你在網站上使用它的經驗–如果你這樣做,請給我一個連結。, 這個外掛在 GitHub 維護,歡迎使用存儲庫報告問題,提...。
Meks Time Ago 》Meks Time Ago WordPress 外掛讓您可以輕鬆將文章日期顯示改為「多久以前」的格式,例如「1小時前」、「2週前」、「5個月前」、「4天前」等,同時提供多種選...。
Bulk Post Update Date 》使用這個外掛可以一鍵更改所有文章和頁面的發布日期和更新日期,有助於您的部落格在搜尋引擎中排名並且看起來更有活力。建議每週或每個月進行一次更改。, 為...。
Bulk Datetime Change 》可批量變更文章的日期/時間。, 可變更的物件, , 文章。, 頁面。, 媒體檔案。, , 日期/時間選擇器, , 可使用 DateTimePicker,一款 jQuery 外掛,選擇日期/時...。
Persian Date 》這個外掛可在 WordPress 中使用波斯曆日期。, 功能, 目前只能將日期轉換為波斯曆!如果您已安裝 WooCommerce,在菜單「WooCommerce Persian」下安裝「WooComm...。
Seed Buddhist Year 》Seed Buddhist Year可以將輸出的年份改為佛曆或佛教紀元(BE),但不會影響使用基督教/西曆(CE)的微格式。, 只需安裝插件,即可覆蓋以下功能:, , get_the_...。
Post Date Time Change 》, 批次更改每篇文章、頁面或媒體庫的日期和時間。, 與 DateTimePicker 一起運作。這是一個 jQuery 外掛,可以選擇日期和時間。, 。
Limit Modified Date 》警告:此外掛已不再受支援,可能無法與古騰堡區塊編輯器兼容。, 我建議改用 Change Last Modified Date 外掛。, 概要, 當對內容進行輕微更改時,避免修改日期...。
InstallActivateGo Copyright Current Date Shortcodes 》重要提示:支援已轉移至 ZATZLabs 網站,不再在 WordPress.org 論壇提供。如果您需要開發人員的即時回覆,請提交工單。, 如果您需要顯示當前年份並使其保持最...。