【发布时间】:2017-04-19 22:57:41
【问题描述】:
我有一个小问题。我正在开发一个带有 wordpress 和主题“barletta”的网站。此主题将文本添加到我要删除的页脚中。通常我通过编辑footer.php 来做到这一点,但这个主题是不同的。我必须更改functions.php,因为有这段代码:
function barletta_footer_credits() {
?>
<div class="site-info">
<?php if (get_theme_mod('barletta_footer_text') == '') { ?>
© <?php echo date('Y'); ?> <?php bloginfo( 'name' ); ?><?php esc_html_e('. All rights reserved.', 'barletta'); ?>
<?php } else { echo esc_html( get_theme_mod( 'barletta_footer_text', 'barletta' ) ); } ?>
</div><!-- .site-info -->
<?php
$nofollow="";
if (!is_home()) { $nofollow="rel=\"nofollow\""; }
printf( esc_html__( 'Theme by %1$s Powered by %2$s', 'barletta' ) , '<a href="http://moozthemes.com/" target="_blank" '.$nofollow.'>MOOZ Themes</a>', '<a href="http://wordpress.org/" target="_blank">WordPress</a>');
}
add_action( 'barletta_footer', 'barletta_footer_credits' );
我的 PHP 不太好,所以我的问题是:如何编辑此代码以使 site-info-div 仍显示但不显示打印文本(由...提供支持)?
【问题讨论】:
标签: php wordpress themes footer