首页 > 解决方案 > 如何在我的子主题中覆盖 wordpress 父主题功能?

问题描述

我正在尝试在我的子主题中更新此父主题功能的内容,但是一旦将其复制到子主题 functions.php 文件中,我就会在浏览器中收到此错误“该站点遇到技术问题。请检查您的站点管理员电子邮件收件箱以获取说明。”

我只想更新函数正文中的文本。请问我该怎么做?

function oblique_footer_credits() {
    echo '<a href="' . esc_url( __( 'http://wordpress.org/', 'oblique' ) ) . '" rel="nofollow">';
    /* translators: WordPress */
        printf( __( 'Proudly powered by %s', 'oblique' ), 'WordPress' );
    echo '</a>';
    echo '<span class="sep"> | </span>';
    /* translators: 1 - Theme author 2 - Theme name */
    printf( __( 'Theme: %2$s by %1$s.', 'oblique' ), 'Themeisle', '<a href="http://themeisle.com/themes/oblique/" rel="nofollow">Oblique</a>' );
    echo '</div>';
}
add_action( 'oblique_footer', 'oblique_footer_credits' );

标签: phpwordpress

解决方案


推荐阅读