If you get a “headers already sent by” error in WordPress, it could indicate a syntax error in function.php in general. In particular, this problem can occur when the PHP start tag is incorrect.
The PHP start tag must be written as <?php
, but if it is mistakenly written as <?
in the shortened form, this error will occur.
Therefore, to eliminate the error, check the PHP start tag in function.php and correct it to <?php
if necessary.