文章最后更新时间:
AI内容摘要 (缓存)
文章探讨了在未登录时,网站全站图片模糊的现象及其原因。通过代码演示和教程,解释了如何利用CSS样式使图片模糊,并指出这是由于用户未登录导致的。文章还提供了将该代码添加到WordPress主题文件夹下的示例。
在网络浏览中,你是否遇到过未登录时全站图片模糊的情况?这并非偶然。今天的博客就来为大家深入剖析其背后的原因与巧妙用法,让你对这一现象有全新认知。
效果演示
![图片[1]-未登录时全站图片模糊-GOGO社区](http://ap.cpolar.cn/wp-content/uploads/2024/12/20241220154132251-17346804922024122007413234.webp)
代码
function blur_style(){
echo '<style>
img {
-webkit-filter: blur(10px)!important;
-moz-filter: blur(10px)!important;
-ms-filter: blur(10px)!important;
filter: blur(6px)!important;
}
</style>';
}
if( !is_user_logged_in()) {
add_action( 'wp_head', 'blur_style' );
}
使用教程
将上述代码代码放入到zibll文件夹下function.php文件中或者新建一个func.php放入其中并进行修改。
© 版权声明
THE END



















暂无评论内容