drb0901500211 2012-08-05 15:05
浏览 26
已采纳

如何在不编辑核心WP文件的情况下删除wp.login.php中的Powered by Wordpress链接?

I would like to remove the Powered by Wordpress (wordpress.org) link that is attached to the logo in wo-login.php or else update it without having to edit the core files. Is it possible to do this?

Kyle

  • 写回答

2条回答 默认 最新

  • dongyan1625 2012-08-05 21:54
    关注

    In your theme's functions.php file, add this:

    function my_login_css() {
        echo '<link rel="stylesheet" href="' . get_stylesheet_directory_uri() .'/path_to_dir_in_your_theme/login.css">';
    }
    
    add_action('login_head', 'my_login_css');
    

    Then just create your custom login.css file that makes whatever changes you want.

    To change the link and alt text on the login logo from Wordpress.org to the title/url for your site, use these filters in your functions.php file:

    // changing the logo link from wordpress.org to your site 
    function my_login_url() { echo bloginfo('url'); }
    
    // changing the alt text on the logo to show your site name 
    function my_login_title() { echo get_option('blogname'); }
    
    // calling it only on the login page
    add_filter('login_headerurl', 'my_login_url');
    add_filter('login_headertitle', 'my_login_title');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 5037端口被adb自己占了
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导