最新消息:郑州SEO笔记与大家一起分享和学习seo知识,一起分析网站seo案例,探析seo技巧!

WordPress程序提示:Warning: file_get_contents()

网站建设 admin 2006浏览

下载了云落的主题,但是突出出现提示:

Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in 网站主题路径/functions.php on line 1116

找到functions.php文件的1116行发现是登录界面的背景,是调用的bing的图片,发现是服务器出现问题,防火墙屏蔽了接口,所以导致了该WordPress程序的主题出现错误。可以先注释掉,也可以和idc客服联系解决。

/*function custom_login_head() {
$str = file_get_contents(‘http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1’);
if (preg_match(“/<url>(.+?)<\/url>/ies”, $str, $matches)) {
if(git_get_option(‘git_loginbg’)){
$imgurl = git_get_option(‘git_loginbg’);
}else{
$imgurl = ‘http://cn.bing.com’ . $matches[1];
}
echo ‘<style type=”text/css”>#reg_passmail{display:none!important}body{background: url(‘ . $imgurl . ‘);background-repeat: no-repeat;background-position: top center;background-attachment: fixed;background-size: cover;width: 100%!important;height: 100%!important;}.login label,a {font-weight: bold;}.login-action-register #login{padding: 5% 0 0;}.login-action-register h1 {display: none;}.login p {line-height: 1;}.login form {margin-top: 10px;padding: 16px 24px 16px;}h1 a { background-image:url(‘ . home_url() . ‘/favicon.ico)!important;width:32px;height:32px;-webkit-border-radius:50px;-moz-border-radius:50px;border-radius:50px;}#registerform,#loginform {background-color:rgba(251,251,251,0.3)!important;}.login label,a{color:#000!important;}</style>’;
}
}
add_action(‘login_head’, ‘custom_login_head’);
add_filter(‘login_headerurl’, create_function(false, “return home_url();”));
add_filter(‘login_headertitle’, create_function(false, “return get_bloginfo(‘name’);”));
/*
* 强制阻止WordPress代码转义,关于代码高亮可以看这里
*/
直接在注释掉了这些代码后,登录界面的Warning提示没有了,但是登录界面的背景图片也没有了,不过影响不大。

转载请注明:郑州SEO优化_郑州网站优化 » WordPress程序提示:Warning: file_get_contents()