內容簡介
使用簡單的短碼,根據日期範圍排定 HTML 區塊的顯示或非顯示。
目前,使用旋轉器短碼啟用此外掛。例如,若要指定我們要在早上九點到下午五點顯示特定的 HTML,可以使用以下代碼:
[rotator start=”9am” end=”5pm”]
某些自訂的 HTML
[/rotator]
其中,啟始和結束參數使用在 PHP 手冊 中指定的日期格式。因此,您可以指定更特定的日期,例如在上午十點至十一點之間每個星期二顯示 HTML 區塊等。有關詳細信息,請閱讀其他注意事項。
注意:這個範圍是服務器的基於時間的範圍,預設時區為 UTC;換句話說,它取決於服務器的配置時間。您可以在管理控制台的一般設置中設定它。
在 wp 管理控制台中的“設置” ->“排程生成器”頁面中提供了一個基本表單,讓您生成短碼,並可以配置不同的值,例如開始和結束時間。
使用方式
目前,使用旋轉器短碼啟用此外掛。例如,若要指定我們要在早上九點到下午五點顯示特定的 HTML,可以使用以下代碼:
[rotator start=”9am” end=”5pm”]
某些自訂的 HTML
[/rotator]
這將只在用戶訪問博客文章或頁面時顯示內容。
目前,它支持以下參數:
start:指定時間範圍的開始日期,必填。
end:指定時間範圍的結束日期,必填。
visible:false可隱藏html區塊,預設為true。
inverse:指定是否要在時間範圍外顯示html區塊,預設為 false。
啟始和結束參數均使用在 PHP 手冊中指定的日期格式。例如,我們可以指定時間範圍的時區:
[rotator start=”9am -0600″ end=”5pm -0600″]…[/rotator]
注意:在一些安裝中,使用 GMT 表示法無法進行操作;不確定所需的 PHP 版本。
注意:這個範圍是服務器的基於時間的範圍,預設時區為 UTC;換句話說,它取決於服務器的配置時間。您可以在管理控制台的 一般設置中設定它。
在 wp 管理控制台中的“設置” ->“排程生成器”頁面中提供了一個基本表單,讓您生成短碼,並可以配置不同的值,例如開始和結束時間。
配置
此插件的第一行包含用於配置插件的全域變數,例如如果您想從管理->設置頁面停用生成器,以及其他配置。
WP_HTML_ROTATOR_DEBUG:定義是否輸出調試信息。
WP_HTML_ROTATOR_ENABLE_WIDGETS:啟用短碼在文本小工具中的工作。
WP_HTML_ROTATOR_ENABLE_GENERATOR:啟用或禁用短碼生成器在管理面板中可見。
外掛標籤
開發者團隊
原文外掛簡介
Schedule HTML sections to be shown or not based on a date range using a simple shortcode.
Right now the plug-in is enabled by using the rotator shortcode. For example, To specify we want to show a specific piece of HTML from 9am to 5pm you can use the following code:
[rotator start=”9am” end=”5pm”]
Some custom HTML.
[/rotator]
Where start and end parameters are using the date format specified in the php manual, so you can specify more specific dates like showing the HTML section all Tuesday between 10am and 11am, etc. Read the Other Notes section for more information.
Note: the hour range is server based time and the default timezone is UTC, in other words, it depends on the configured time of the server, you can set that in general settings at the admin console.
There is a page available at “Settings” -> “Schedule generator” in the wp admin console with a basic form which lets you generate the short code configuring different values like start and end times, among others.
Usage
Right now the plug-in is enabled by using the rotator shortcode. For example, To specify we want to show a specific piece of HTML from 9am to 5pm you can use the following code:
[rotator start=”9am” end=”5pm”]
Some custom HTML.
[/rotator]
That will show the contents only if the user access the blog post or page in the specified hour range.
Currently, it supports the following parameters:
start: a date to specify the start of the hour range, required.
end: a date to specify the end of the hour range, required.
visible: false to hide the html section, by default true.
inverse: to specify if we want to show the html section outside the our range, by default false.
Both start and end are using the date format specified in the php manual. For example, we can specify the timezone of the hour range:
[rotator start=”9am -0600″ end=”5pm -0600″]…[/rotator]
Note: Using GMT notation doesn’t work in some installations, not sure which php version is required for that to work.
Note: the hour range is server based time and the default timezone is UTC, in other words, it depends on the configured time of the server, you can set that in general settings at the admin console.
There is a page available at “Settings” -> “Schedule generator” in the wp admin console with a basic form which lets you generate the short code configuring different values like start and end times, among others.
Configuration
The first lines of the plugin contains some global variables to configure the plugin, for example, if you want to disable the generator from the admin -> settings page, among other configurations.
WP_HTML_ROTATOR_DEBUG: defines if the plugin echoes debug information.
WP_HTML_ROTATOR_ENABLE_WIDGETS: enables the shortcode to work on text widgets.
WP_HTML_ROTATOR_ENABLE_GENERATOR: enable the shortcode generator to be shown in the admin panel or not.
