內容簡介
總結:
IDM Post Date Archive Link 是一款輕量級的 WordPress 外掛,提供專用的區塊和短代碼,動態顯示文章或頁面的發布日期或最後修改日期。這工具提供靈活性,讓您可以選擇顯示發布日期或最後修改日期,同時可以將顯示的日期連結到不同類型的日期存檔。
問題與答案:
1. IDM Post Date Archive Link 外掛的核心功能是什麼?
- 提供顯示彈性,可選擇顯示發佈日期或最後修改日期,並能將日期連結至不同類型的日期存檔。
2. 使用這款外掛主要適合哪些人?
- 適合 Full Site Editing (FSE) 佈景主題以及那些需要對日期格式和鏈結目的地有精確控制的使用者。
3. 如何使用 Block 功能?
- 在 WordPress 佈景主題中將 Block 命名為 "IDM Post Date Archive Link",並能在區塊檢查器側邊欄中自訂設置,包括使用自訂日期格式、啟用日期連結、顯示最後修改日期等。
4. 如何在外掛中使用 Shortcode?
- 可在支援區域中使用 [ipdal] 短代碼,或在經典主題模板中加入 do_shortcode('[ipdal]'),可設定不同屬性,如連結、最後修改日期、日期格式和自訂文字前綴。
外掛標籤
開發者團隊
原文外掛簡介
IDM Post Date Archive Link is a lightweight plugin that provides a dedicated block and a shortcode for dynamically displaying the publication date, or the last modified date, of a post or page.
Its core function is to offer display flexibility, allowing you to choose between the publication date or the last modified date. Furthermore, it enables linking the displayed date to different types of date archives.
This tool is perfect for Full Site Editing (FSE) themes and for users who require precise control over the date’s format and link destination within their templates and content.
Features
Gutenberg Block: Fully compatible with the block editor and FSE themes.
Date Selection: Choose to display the published date (default) or the last modified date.
Archive Links: Option to link the date to the yearly, monthly, or daily archive of the current post, to its permalink, or display it as plain text.
Custom Formatting: Supports date/time formatting using standard PHP formatting characters.
CPT Support: Correctly handles archive links for Custom Post Types by appending their slug to the URL.
Shortcode: Includes the shortcode for backward compatibility and use in widget areas or the Classic Editor.
Usage
Block
The block is registered as “IDM Post Date Archive Link” under the Theme category. Once inserted, you can customize it using the available settings in the Block Inspector sidebar:
Use custom format: Override the default date format (set in the general settings) with a custom one.
Enable date link: Make the date clickable by linking it to the post or a date archive.
Display last modified date: If the post has been modified, display the last modified date instead of the publication date.
Date prefix: Custom text prefix to add before the date (e.g., “Published on:”).
The block can be styled using the Styles panel of Block Inspector sidebar. To match the current theme style, apply the class “wp-block-post-date” to the block (same class of Post Date core block).
Shortcode
You can use the [ipdal] shortcode in any supported area (shortcode block, widgets, classic editor), or in a classic theme template with: .
Available attributes are:
link : Make the date clickable by linking it to the post or a date archive.
Accepted Values: post, day, month, year, none
Default: post
modified : If the post has been modified, display the last modified date instead of the published date.
Accepted Values: true, false
Default: false
format : Override the default date format (set in the general site settings) with a custom one.
Accepted Values: Any date format string like “d/m/Y” or “timeago” for relative date format.
Default: default
text : Custom text prefix to add before the date.
Accepted Values: Any string (e.g., “Published on:”)
Default: '' (none – empty string)
Example:
[ipdal modified="true" link="month" format="m/d/Y" text="Updated:"]
( this sample will displays the last modified date linked to the monthly archive, with the format month/day/year, and “Updated:” as custom text prefix )
The shortcode can be styled with custom CSS by referencing its class: “idm-post-date-archive-link_shortcode“.
