wordpress 登录图片,样式

来源:互联网 发布:淘宝二层牛皮除牛反绒 编辑:程序博客网 时间:2024/05/17 00:00

通过修改主题(可以在你的后台观看是那个主题)
这里写图片描述
在\wordpress\wp-content\themes+刚刚的模版名。中的模板函数function.php添加相应的功能函数来完成对WordPress博客登录页面logo的全方位替换。将下列代码复制粘贴到function.php函数闭合中。

//更换登录logo图片 function custom_loginlogo() { echo '<style type="text/css"> h1 a {background-image: url('.get_bloginfo('template_directory').'/images/logo-login.png) !important; } </style>'; } add_action('login_head', 'custom_loginlogo');

自己logo图片上传到指定的目录。

//更换登录logo链接 add_filter("login_headerurl", create_function(false,"return get_bloginfo('siteurl');"));//更换登录logo描述 add_filter("login_headertitle", create_function(false,"return get_bloginfo('description');"));// 自定义logo css样式 function custom_login() { echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('template_directory') . '/custom-login.css" />'; } add_action('login_head', 'custom_login');