
內容簡介
基本使用方式
此外掛即裝即用,安裝完成後您可以在任意地方使用簡碼。
使用簡碼 [pcf_tg_countdown],以輸出倒數計時。
預設的輸出格式為天數(例如:「距離感恩節還有105天!」)。
修改輸出格式
簡碼可以加上一個「類型」屬性(type attribute),詳見以下範例:
[pcf_tg_countdown type="days|weeks|sleeps"]
這個屬性可以讓您更改輸出的格式。
有三種格式可供選擇:
天數
週數
睡眠數
如果沒有指定類型屬性,或者指定了無效屬性,它會預設為「天數」。
範例:
[pcf_tg_countdown type="weeks"]
會輸出為
距離感恩節還有 `x` 週 `y` 天!
設計輸出樣式
設計輸出樣式是進階設定,需要撰寫自訂 CSS 樣式。
簡碼可以加上「ID」屬性(id attribute),然後使用 CSS 樣式設計輸出格式。
例如:
[pcf_tg_countdown id="my-id"]
會輸出 HTML 為:
<p id="my-id">...</p>
然後,您可以透過 外觀 > 編輯器 加上自訂 CSS。如果您的佈景主題支援自訂 CSS,您也可以在主題選項中加上樣式。如果編輯器中有自訂 CSS 檔案,建議使用該檔案設計自己的樣式。
以下是一個自訂樣式的範例:
#my-id{
color: red;
font-size: 16px;
text-decoration: underline;
}
這會讓輸出的文字呈紅色,有底線且字體大小為 16px。
外掛標籤
開發者團隊
原文外掛簡介
Basic Instructions
This plugin works out-of-the-box, so once the plugin is installed, you can place a shortcode wherever you want.
Use the shortcode [pcf_tg_countdown] to output the countdown.
The countdown will output in days by default (e.g ‘105 days until Thanksgiving!’).
Changing output type
The shortcode can be given a ‘type’ attribute, like so:
[pcf_tg_countdown type="days|weeks|sleeps"]
This enables you to change the output type.
There are 3 types to choose from:
Days
Weeks
Sleeps
If you do not specify the type attribute, or specify an invalid type, it will default to ‘days’.
Example:
[pcf_tg_countdown type="weeks"]
will output as
It's `x` weeks and `y` days until Thanksgiving!
Styling the output
Styling the output is an advanced setting, that involves writing custom CSS.
The shortcode can be given an ‘id’ attribute, which can then be used to style the output using CSS.
For example,
[pcf_tg_countdown id="my-id"]
would output in HTML as
...
You can then add custom CSS through Appearance > Editor. If your theme supports custom CSS, you may be able to add your styles in Theme Options. If there is a custom css file in Editor, it is advised to use that for custom styles.
Here is an example of some custom styles:
#my-id{
color: red;
font-size: 16px;
text-decoration: underline;
}
This will set the output to be red, underlined, and to have a font size of 16px.
