有可能在不同的页面上有不同的图标吗?
For example:
mywebsite.com/blog-1 -> favicon-1
mywebsite.com/blog -> favicon-2
等等。我有每个博客的自定义域名(我不想在这些页面上使用相同的域名)
有可能在不同的页面上有不同的图标吗?
For example:
mywebsite.com/blog-1 -> favicon-1
mywebsite.com/blog -> favicon-2
等等。我有每个博客的自定义域名(我不想在这些页面上使用相同的域名)
从WordPress版本5.6开始,任何帖子或页面在编辑器上都有选项,可以在页面标题中包含任何自定义脚本/样式和元标记。所以如果你把你的<;链接rel“;“图标”;href=“;法维康。巴布亚新几内亚“/&燃气轮机;它应该会起作用。
您将favicon上传到媒体中,然后再上传媒体。请直接将上传的favicon png图像参考链接。
标题块中的favicon示例
<link rel="icon" href="https://domainname.com/uploads/2020/10/10/favicon-32x32.png" />
您可以使用一些解决方案;
在页面/帖子中使用favicon创建元字段。把这个叫做你的header.php
文件但如果元字段为空,请不要忘记设置默认值apply_filter 并为此创建筛选器is_page(), is_singular(\'product\')
等等header.php 和使用add_action(\'wp_head\', \'your_functions_tags\');
header-{slug}.php. header-fav1.php, header-fav2.php
然后像这样调用模板<?php get_header(\'fav1\'); ?>
此列表中的某些内容必须对您有所帮助。
这可能有点过头了,但如果你想把favicon换成特定的页面、帖子存档,甚至是单个帖子,那么这里有一些东西可以帮助你达到目的。希望它足够干净,可以保养。您可以访问WordPress提供的任何类型的is\\uConditional。
<?php
switch(true){
case is_page(27) :
$favicon_link = \'link_to_favicon_one.png\';
break;
case is_page(array(23, 40, 44, 60)) :
$favicon_link = \'link_to_favicon_two.png\';
break;
case is_post_type_archive() :
$favicon_link = \'link_to_favicon_three.png\';
break;
case is_single(2001) :
$favicon_link = \'link_to_favicon_four.png\';
break;
default : // Always need a fallback
$favicon_link = \'link_to_favicon.png\';
break;
}
?>
<link rel="icon" href="<?=$favicon_link?>" sizes="32x32" />
希望这对别人有帮助!处理用户登录的功能在哪里?具体来说,就是在登录页面检查用户的纯文本密码与数据库中存储的哈希格式密码的密码?