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.
如果您需要每天或在特定事件期间使用此插件使用不同的徽标,则可以完全自定义网站标题/徽标管理。 p>
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.
默认情况下,开始时间为00:00,结束时间为23:59。 p>
You can provide 2 different templates for the header/logo HTML snippet.
您可以为标题/徽标HTML代码段提供2个不同的模板。
Imagine having different layout for desktop or mobile.
想象一下桌面或移动设备的布局不同。
The algorithm for choosing the templates is demanded to you.
您需要选择模板的算法。 p>
There is 2 different actions that you can use:
您可以使用2种不同的操作: p>
- daily_logo_show_today / daily_logo_show_today_alternative (display daily logo)
- daily_logo_show_today / daily_logo_show_today_alternative(显示每日徽标) li>
- daily_logo_show_date / daily_logo_show_date_alternative (display a custom date logo)
- daily_logo_show_date / daily_logo_show_date_alternative(显示自定义日期徽标) li>
ul>
Here you can find and example of template detection in a PHP template file (e.g. header.php):
在这里您可以在PHP模板文件(例如header.php)中找到模板检测的示例: p>
$is_mobile = false; $ is_mobile = false;if ($is_mobile) do_action( 'daily_logo_show_today_alternative' );
如果($ is_mobile)do_action('daily_logo_show_today_alternative');
else do_action( 'daily_logo_show_today' );
其他do_action('daily_logo_show_today');
$is_mobile = false;
$ is_mobile = false;
if ($is_mobile) do_action( 'daily_logo_show_date_alternative', 2015, 5, 12 );
if($ is_mobile)do_action('daily_logo_show_date_alternative',2015,5,12);
else do_action( 'daily_logo_show_date', 2015, 5, 12 );
else do_action('daily_logo_show_date',2015,5,12);
code> pre>
The action with the “alternative” suffix is used for the second template layout.
后缀为“ alternate”的操作用于第二个模板布局。 p>
Usage
用法 h4>
- Go to
WP-Admin -> Daily Logo
. - 转到
WP-Admin->每日徽标 code>。 li>- Add, modify, clone or delete a daily logo or configure the default templates.
- 添加,修改,克隆或删除每日徽标或配置默认模板。 li>
- Replace in your the logo HTML snippet with the following code
do_action( 'daily_logo_show_today' )
. - 用以下代码
do_action('daily_logo_show_today') code>替换您的徽标HTML代码段。 li>
ol>
Links: Author’s Site
链接:作者的网站 p>