2014-02-10 53 views
0

在我的functions.php中,当我只为一个自定义帖子类型添加代码时,它可以正常工作,但添加了另一个自定义帖子类型。它显示此错误 -错误在wordpress主题中添加第二个自定义帖子类型

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wordpress/wp-content/themes/mytheme/functions.php:83) in /home/public_html/wordpress/wp-includes/pluggable.php on line 896 

为什么会发生这种情况,以及可能的解决方案是什么?

+0

当你的服务器将内容发送到客户端,就会出现此错误,然后尝试修改标题。检查你的代码,看看你是用echo还是在页面上打印任何东西 – Ibu

回答

0

检查线你的functions.php文件。
您可能在它后面有一个关闭php标记和新行/空白。在关闭标签后删除任何不必要的空白。

参考 - How to fix "Headers already sent" error in PHP

+0

非常感谢@Kaloyan Ivanov ...我删除了额外的空白空间,现在它可以工作。 – Ronn

相关问题