获得最佳 DMCA 保护徽章的最佳方式
ARTRU

在您的网站上贴上 DMCA 保护徽章后,也许没有多少人会关注速度或 SEO 问题。
以下是 DMCA 要求您附加到网络的代码:
尝试访问 PageSpeed 见解 检查您的网站是否存在任何与 DMCA 相关的错误。
如果用户使用广告拦截器扩展程序,则无法加载 DMCA 图像。
你需要更多的属性 width height
对于卡 <img>
.
DMCA 保护徽章通常位于页面底部。这样你就可以设置更多的属性 loading="lazy"
.
您应始终将 DMCA 徽章的图像保存在您的网站上,以避免用户使用广告拦截器时出现错误。
文件 <script>
它实际上只是将函数添加到标签尾部的 JavaScript 代码 <a href
部分 &refurl={url}
. {url}
是当前页面的url。
您可以直接使用函数编写,而不是使用 JavaScript 代码 get_permalink()
在 WordPress 中。
以下是我如何使用 DMCA 保护徽章:
<a target="_blank" href="https://www.dmca.com/Protection/Status.aspx?ID=f403b2c1-8e2d-4993-8c7a-2d7da934eb4c&refurl=<?php echo get_permalink(); ?>" class="dmca-badge">
<img loading="lazy" width="100" height="20" src ="https://cdn.artru.io.vn/wp-content/uploads/2023/07/dmca-badge.png" alt="DMCA.com Protection Status" />
</a>
如果您使用源代码 PHP
纯粹的,你可以像这样使用这个函数:
function get_permalink() {
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://';
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['REQUEST_URI'];
return $protocol . $host . $uri;
}
$current_permalink = get_permalink();
echo $current_permalink;
相关文章