[WordPress] 外掛分享: Shortcode for Current Date

首頁外掛目錄 › Shortcode for Current Date
WordPress 外掛 Shortcode for Current Date 的封面圖片
10,000+
安裝啟用
★★★★★
5/5 分(115 則評價)
87 天前
最後更新
問題解決
WordPress 5.0+ v2.2.2 上架:2017-05-06

內容簡介

「當前日期 Shortcode」外掛能夠透過簡單的縮短代碼在你的 WordPress 網站上任何地方顯示當前日期、當前月份或當前年份。

只需使用縮短代碼 [current_date],當文章或頁面顯示時,[current_date] 將被替換為當前日期。日期將根據你的站點設置自動翻譯。

預設的日期格式為「2017年5月7日」。

但你可以根據自己的需求進行自定義。為此,你需要使用縮短代碼屬性引入日期格式。
以下是一些範例:

[current_date format=’d/m/Y’] 將顯示日期格式:07/05/2017
[current_date format=’F d, Y’] 將顯示日期格式:May 07, 2017

如果你不明白日期格式如何設定,也沒有關係。

Gutenberg 區塊

如果你正在使用 Gutenberg 編輯器,就可以使用「當前日期區塊」在文章/頁面中插入當前日期。

如果使用此區塊,就不需要使用簡短代碼了。

插入區塊後,在右側邊欄的區塊選項中,你可以看到設置日期格式的欄位。

樣式

使用「size」和「color」屬性進行日期樣式設置。

例如,[current_date format=’d/m/Y’ size=’20px’ color=’#FF0000′]

下一步要做什麼

如果你喜歡這個外掛,請考慮查看我們的其他外掛:

WP Table Builder - 拖曳式表格生成器外掛。非常容易建立響應式表格。
Ultimate Blocks - 利用Gutenberg + Ultimate Blocks 創建更好的內容。博客作者和聯盟行銷人員必備的區塊集合。
WP Coupons and Deals - 從您的聯盟優惠券和優惠中賺取更多收入。

訪問WPLeaders以了解更多有關WordPress、WordPress 主題和外掛的信息。

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.2.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Shortcode for Current Date」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Shortcode for Current Date enables you to put current date, current month or current year anywhere in your WordPress site with a simple shortcode.
Just use the shortcode [current_date] and when the post or page is displayed, [current_date] will be replaced by the current date. And the date will be translated according to your site settings.
By default it will show a date like this: 7th May 2017
But you can customize it to your needs. To do that, you’ll need to pass the date format using an attribute with the shortcode.
Here are some examples:
[current_date format=’d/m/Y’] will show the date like this: 07/05/2017
[current_date format=’F d, Y’] will show the date like this: May 07, 2017
If you don’t understand how this formatting works, that’s totally okay.
Gutenberg Block
If you are using Gutenberg editor, there’s a Current Date block you can use to insert the current date in your posts/pages.
If you use the block, you will not have to use the shortcode.
When you insert the block, on the right sidebar under block options you will see a field to put the format for the date.
Styling
You can use ‘size’ and ‘color’ attributes to style the date.
For example, [current_date format=’d/m/Y’ size=’20px’ color=’#FF0000′]
What’s Next
If you like this plugin, then consider checking out our other plugins:

WP Table Builder – Drag and Drop Table Builder Plugin. Build Responsive Tables insanely easily.
Ultimate Blocks – Create Better Content with Gutenberg + Ultimate Blocks. Essential Collection of Blocks for Bloggers and Affiliate Marketers.
WP Coupons and Deals – Make More Money from Your Affiliate Coupons and Deals.

Visit WPLeaders to learn more about WordPress, WordPress themes and plugins.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon