
內容簡介
Daily Logo 是一個簡單靈活的 WordPress 外掛,允許使用者每天在其網站上顯示不同的標頭/標誌。如果你需要每天或在特定活動期間有不同的標誌,則使用此外掛可以完全自定義你的網站標頭/標誌管理。
當你安裝並啟用該外掛時,會新增一個管理區域。該區域包含兩個頁面,第一個頁面自動列出了你所有配置的每日標誌,第二個頁面包含一個小圖例,你可以設置默認的外觀模板。
你可以為每個標誌提供開始時間和結束時間。默認情況下,開始時間為 00:00,結束時間為 23:59。
你可以為標頭/標誌 HTML 段提供 2 個不同的模板。想像一下,你可以為桌面或移動設備設置不同的版面。選擇模板的演算法由你決定。
有 2 個不同的操作可以使用:
daily_logo_show_today / daily_logo_show_today_alternative(顯示每日標誌)
daily_logo_show_date / daily_logo_show_date_alternative(顯示自訂日期標誌)
這裡可以找到在 PHP 模板文件(例如 header.php)中檢測模板的示例:
$is_mobile = false;
if ($is_mobile) do_action( 'daily_logo_show_today_alternative' );
else do_action( 'daily_logo_show_today' );
$is_mobile = false;
if ($is_mobile) do_action( 'daily_logo_show_date_alternative', 2015, 5, 12 );
else do_action( 'daily_logo_show_date', 2015, 5, 12 );
帶有“alternative”後綴的動作用於第二個模板版面。
你可以在代碼中使用短代碼 [daily_logo_history_table] 來顯示包含所有數據歷史的表格。
使用方法
前往 WP-Admin -> Daily Logo。
添加、修改、複製或刪除每日標誌,或配置默認模板。
在你的標誌 HTML 段中使用以下代碼替換:do_action( 'daily_logo_show_today' )。
連結:作者網站
外掛標籤
開發者團隊
原文外掛簡介
Daily logo is a simple and flexible plugin which allow users to display a different header/logo in their site every day. If you need to have a different logo every day or during a particular event with this plugin you can completely customize your site header/logo management.
When you install and activate the plugin, an admin section is added. The section is composed by 2 pages, in the first one are automatically listed all your configured daily logos, in the second one, you can see a small legend and you can setup default look & feel templates.
You can provide a starting time and an ending time for every logo. By default the start time is 00:00 and the end time is 23:59.
You can provide 2 different templates for the header/logo HTML snippet. Imagine having different layout for desktop or mobile. The algorithm for choosing the templates is demanded to you.
There is 2 different actions that you can use:
daily_logo_show_today / daily_logo_show_today_alternative (display daily logo)
daily_logo_show_date / daily_logo_show_date_alternative (display a custom date logo)
Here you can find and example of template detection in a PHP template file (e.g. header.php):
$is_mobile = false;
if ($is_mobile) do_action( 'daily_logo_show_today_alternative' );
else do_action( 'daily_logo_show_today' );
$is_mobile = false;
if ($is_mobile) do_action( 'daily_logo_show_date_alternative', 2015, 5, 12 );
else do_action( 'daily_logo_show_date', 2015, 5, 12 );
The action with the “alternative” suffix is used for the second template layout.
You can use the shortcode [daily_logo_history_table] in your code for displaying a table with all the data history.
Usage
Go to WP-Admin -> Daily Logo.
Add, modify, clone or delete a daily logo or configure the default templates.
Replace in your the logo HTML snippet with the following code do_action( 'daily_logo_show_today' ).
Links: Author’s Site
