Perfmatters – WordPress 添加代码到页眉,主体,页脚

有时,您可能需要将自定义代码添加到 WordPress 网站的页眉、正文或页脚。

一个很好的例子就是你的 favicon。

我们始终建议从 CDN 加载 favicon,对于大多数主题,您需要手动指定。

在我们的网站上,我们在标题中加载以下内容。

<link rel=”icon” href=”https://cdn.perfmatters.io/wp-content/uploads/2017/08/favicon.png” type=”image/x-icon” />

使用 Perfmatters 插件,您可以轻松地将任何自定义代码放入页眉、正文和页脚中。

接受哪种类型的代码?
下面的框直接在前端打印出代码,因此它需要是有效的HTML。这可能包括 <style> 标记中的内联 CSS 或 <script> 标记中包含的内联 JS。

您还可以加载 JS 或 CSS 文件。
这些框不接受服务器端语言,如 PHP。

对于添加自定义 PHP 代码,我们始终建议使用代码段插件。

查看这篇关于如何将PHP添加到WordPress站点的文章。

Log In

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

Add to Collection

No Collections

Here you'll find all collections you've created before.