我在用Genesis主题向页脚添加动态网站名称/标题时遇到问题。根据他们的短代码参考,我认为我应该能够将其添加到下面的代码中,以代替可编辑的链接。我的意思是:
//* Change the footer text
add_filter(\'genesis_footer_creds_text\', \'sp_footer_creds_filter\');
function sp_footer_creds_filter( $creds ) {
$creds = \'[footer_copyright] <a href="/">Editable Link</a>\';
return $creds;
}
但是,当我用以下内容替换可编辑链接文本时$creds = \'[footer_copyright] <?php echo get_bloginfo( \'name\' ); ?>\';
我得到:Your PHP code changes were rolled back due to an error on line 291 of file wp-content/themes/genesis-sample-develop/functions.php. Please fix and try saving again.
syntax error, unexpected \'name\' (T_STRING)
我尝试了<?php echo get_bloginfo( \'name\' ); ?>
但似乎什么都不想起作用。我错过了什么?