标题和图标在 PHP 中不显示



这是我与标题一起使用的标题和链接,但我只得到"文档"一词

<title>Chicken and Waffle | Local 360 | Gunyen&lt;/title>
<link rel="shortcut icon" type="image/png" href="images/gunyen%20logo%20dark.png">;

示例:https://gunyen.com/post/local360chknnwfl.php

我做错了什么?

再次检查您的代码!这是我在浏览器中看到的页面源代码:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>

</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="docsearch:language" content="en">
<meta name="docsearch:version" content="4.3">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link rel="shortcut icon" type="image/png" href="images/gunyen%20logo%20dark.png"/>
<!--https://developers.google.com/search/reference/robots_meta_tag#directives-->
<!--<meta name="robots" content="index, follow, archive">-->
<meta name="robots" content="nofollow, noindex">
...

如您所见,有 2 个头块!

大多数浏览器会从网站的根目录中获取favicon.ico而无需被告知; 但他们并不总是立即用新的更新它。

但是,使用favicon的名称完成任务的正确方法.ico:

<link rel='shortcut icon' type='image/x-icon' href='images/gunyen/logo/favicon.ico' />

参考: https://stackoverflow.com/a/9943834/6366593

最新更新