Php 从Wordpress主题中删除SEO标记

Php 从Wordpress主题中删除SEO标记,php,wordpress-theming,Php,Wordpress Theming,我在删除php文件中的两行代码时遇到问题。当我删除它们时,options.php和post.php上会出现一个白色屏幕,我认为这是一个简单的代码错误,但我没有成功地找到它。我开始使用的代码是 $this->pagetitle=sprintf($format,$title); if ($this->get( 'seo','keywords' )!=''&&$keywords!='')$keywords.=","; if ($this-&g

我在删除php文件中的两行代码时遇到问题。当我删除它们时,options.php和post.php上会出现一个白色屏幕,我认为这是一个简单的代码错误,但我没有成功地找到它。我开始使用的代码是

$this->pagetitle=sprintf($format,$title);
        if ($this->get( 'seo','keywords' )!=''&&$keywords!='')$keywords.=",";
        if ($this->get( 'seo','description' )!=''&&$descr!='')$descr.=" ";
        if (($descrln=200-iconv_strlen($descr, "utf-8"))>=(strpos($this->get( 'seo', 'description' ),' ')))
            $descr.=iconv_substr($this->get( 'seo', 'description' ), 0, $descrln, 'utf-8' );
        if ( $echo ) {
            echo "<title>".sprintf($format,$title)."</title>\r\n";
            echo '<meta name="Description" content="'.preg_replace('/[\'\"]/', '',$descr)."\" />\r\n";
            echo '<meta name="Keywords" content="'.$keywords.$this->get( 'seo', 'keywords' )."\" />\r\n";
        } else {
            return sprintf($format,$title);
        }
    }

}
$this->pagetitle=sprintf($format,$title);
如果($this->get('seo','keywords')!=''&&$keywords!='')$keywords.='',”;
如果($this->get('seo','description')!=''&$descr!='')$descr.='';
如果($descrln=200-iconv_strlen($descr,“utf-8”))>=(strpos($this->get('seo','description'),''))
$descr.=iconv_substr($this->get('seo','description'),0,$descrln,'utf-8');
如果($echo){
echo“.sprintf($format,$title)。”\r\n;
echo'get('seo','keywords')。“\”/>\r\n”;
造成问题的结果是

$this->pagetitle=sprintf($format,$title);
        if ($this->get( 'seo','keywords' )!=''&&$keywords!='')$keywords.=",";
        if ($this->get( 'seo','description' )!=''&&$descr!='')$descr.=" ";
        if (($descrln=200-iconv_strlen($descr, "utf-8"))>=(strpos($this->get( 'seo', 'description' ),' ')))
            $descr.=iconv_substr($this->get( 'seo', 'description' ), 0, $descrln, 'utf-8' );
        if ( $echo ) {
            echo "<title>".sprintf($format,$title)."</title>\r\n";
        } else {
            return sprintf($format,$title);
        }
    }

}
$this->pagetitle=sprintf($format,$title);
如果($this->get('seo','keywords')!=''&&$keywords!='')$keywords.='',”;
如果($this->get('seo','description')!=''&$descr!='')$descr.='';
如果($descrln=200-iconv_strlen($descr,“utf-8”))>=(strpos($this->get('seo','description'),''))
$descr.=iconv_substr($this->get('seo','description'),0,$descrln,'utf-8');
如果($echo){
echo“.sprintf($format,$title)。”\r\n;
}否则{
返回sprintf($format,$title);
}
}
}

有趣的是,如果你右键单击页面查看源代码,你得到了什么吗?如果你打开浏览器控制台日志,它是否报告了任何错误?当我删除这两行时,它修复了标签问题,网站在前端正常工作。唯一的问题是,当我更新帖子或页面时,我登录到广告时会看到一个白色屏幕min.更新已保存,但我必须返回主管理视图才能继续。您的wordpress版本是什么?您使用的主题是什么?默认版本还是附加组件?版本3.8.1,主题是smthemes.com的SportsBlog。有人有什么想法吗?
$this->pagetitle=sprintf($format,$title);
        if ($this->get( 'seo','keywords' )!=''&&$keywords!='')$keywords.=",";
        if ($this->get( 'seo','description' )!=''&&$descr!='')$descr.=" ";
        if (($descrln=200-iconv_strlen($descr, "utf-8"))>=(strpos($this->get( 'seo', 'description' ),' ')))
            $descr.=iconv_substr($this->get( 'seo', 'description' ), 0, $descrln, 'utf-8' );
        if ( $echo ) {
            echo "<title>".sprintf($format,$title)."</title>\r\n";
        } else {
            return sprintf($format,$title);
        }
    }

}