解析错误:语法错误,意外的T_函数请帮助包括/theme_filters.php
请在我的服务器上使用我的wordpress主题时出现以下错误,请任何人帮助解释发生这种情况的原因 解析错误:语法错误,第1行的/wp content/themes/BookYourTravel/includes/theme_filters.php中出现意外的T_函数 这些是文件中提到的代码解析错误:语法错误,意外的T_函数请帮助包括/theme_filters.php,php,wordpress,Php,Wordpress,请在我的服务器上使用我的wordpress主题时出现以下错误,请任何人帮助解释发生这种情况的原因 解析错误:语法错误,第1行的/wp content/themes/BookYourTravel/includes/theme_filters.php中出现意外的T_函数 这些是文件中提到的代码 <?php /** * Remove password email text if option for users to set their own password is enabled i
<?php
/** * Remove password email text if option for users to set their own password is enabled in Theme settings. */
function remove_password_email_text ( $text )
{
$let_users_set_pass = of_get_option('let_users_set_pass', 0);
if ($text == 'A password will be e-mailed to you.' && $let_users_set_pass)
$text = '';
return $text;
}
add_filter( 'gettext', 'remove_password_email_text' );
?>
您缺少一个
{
和一个}
在这里:
if($text=='将通过电子邮件向您发送密码。&&&$let\u users\u set\u pass)
{/请从服务器下载theme_filters.php文件,并检查其格式是否正确,或者代码是否只有一行。如果代码只有一行,请对其进行格式设置。我在服务器上检查文件时遇到了相同的问题,其显示的代码如下所示:
<?php/*some comment here*/function xyz...?>
<?php
/*some comment here*/
function xyz...
.
.
.
?>
我将此文件格式化如下:
<?php/*some comment here*/function xyz...?>
<?php
/*some comment here*/
function xyz...
.
.
.
?>
现在对我来说很好
祝你好运…你应该格式化你的代码..右大括号应该在add_filter()上方@NathanDawson,谢谢,我不知道wordpress的函数:-)