我已经四处寻找有关更改页脚中版权的说明,目前设置为:
© 2014年多伦多酒猎犬。主题由XtremelySocial和Blacktie设计。
我过去曾找到更改此代码的说明,但对此代码进行了更改:
add_filter('xsbf_credits', 'xsbf_child_credits');
function xsbf_child_credits ( $site_credits ) {
$theme = wp_get_theme();
$site_credits = sprintf( __( '© 2014 - %1$s %2$s'),
date ( 'Y' ),
'<a href="' . esc_url( home_url( '/' ) ) . '" rel="home">' . get_bloginfo( 'name' ) . '</a>'
);
return $site_credits;
}
似乎没有反映在页面上。
以下是作者在代码中的注释:
/*
* OVERRIDE THE SITE CREDITS TO GET RID OF THE "THEME BY XTREMELYSOCIAL" AND JUST LEAVE
* COPYRIGHT YOUR SITE NAME
*
* You can hard-code whatever you want in here, but its better to have this function pull
* the current year and site name and URL as shown below.
*/
我可能没有完全理解 php。最终目标是将其更改为简单的:
2014 - ($currentDate) 多伦多酒猎犬
实现这一目标的最简单方法是什么?
网站 https://torontoboozehound.com
我确实知道同时打开 wpsupercache 和 cloudflare 会使更改需要一些时间,但我清除插件中的缓存并将 cloudflare 置于开发人员模式以及使用隐身模式来查找更改。
谢谢。
简单的方法
转到页脚.php文件并删除:
Theme by %3$s. (line 63)
'<a href="' . $theme->get( 'ThemeURI' ) . '" rel="profile" target="_blank">' . $theme->get( 'Author' ) . '</a>' (line 66)
应该以这种方式结束:
$site_credits = sprintf( __( '© %1$s %2$s.', 'flat-bootstrap' ),
date ( 'Y' ),
'<a href="' . esc_url( home_url( '/' ) ) . '" rel="home">' . get_bloginfo( 'name' ) . '</a>',
);
它应该有效。