【问题标题】:Changing my footer which is PHP, having trouble (wordpress)更改我的页脚 PHP,遇到问题(wordpress)
【发布时间】:2014-12-31 18:03:50
【问题描述】:

我四处寻找有关更改页脚中版权的说明,目前设置为:

© 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.ini 没有完全理解。最终目标是将其更改为简单的:

2014 - ($currentDate) 多伦多酒鬼

最简单的方法是什么?

网站是https://torontoboozehound.com

我确实知道同时打开 wpsupercache 和 cloudflare 会导致更改需要一些时间,但我会清除插件中的缓存并将 cloudflare 置于开发人员模式以及使用隐身模式来查找更改。

谢谢。

【问题讨论】:

标签: php wordpress


【解决方案1】:

简单的方法

转到您的 footer.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( __( '&copy; %1$s %2$s.', 'flat-bootstrap' ), 
        date ( 'Y' ),
        '<a href="' . esc_url( home_url( '/' ) ) . '" rel="home">' . get_bloginfo( 'name' ) . '</a>',
    );

它应该可以工作。

【讨论】:

  • 谢谢,已经成功了!抱歉,我有一段时间没有看到您的回复。
猜你喜欢
  • 2021-08-24
  • 2019-12-05
  • 1970-01-01
  • 2019-07-22
  • 2023-01-18
  • 2020-04-10
  • 2017-01-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多