WordPress自定义登录背景

602次阅读

共计 495 个字符,预计需要花费 2 分钟才能阅读完成。

将以下代码加入至主题目录 Functions.php 文件最后面?>标签前(如果没有?>标签,则直接加到最后面)保存:

/* wordpress登录背景自定义代码 */
function custom_login_head(){
$str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
if(preg_match("/(.+?)<\/url>/ies",$str,$matches)){
$imgurl='http://cn.bing.com'.$matches[1];
echo''; }} add_action('login_head', 'custom_login_head'); add_filter('login_headerurl', create_function(false,"return get_bloginfo('url');")); add_filter('login_headertitle', create_function(false,"return get_bloginfo('name');"));

 

正文完
 
mervinwang
版权声明:本站原创文章,由 mervinwang 2017-08-03发表,共计495字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
文章搜索