Cannot modify header information - error?

Hi,

I get these errors when saving my pages:

Warning: count(): Parameter must be an array or an object that implements Countable in /srv/users/vektropol/apps/vektropol/public/wp-includes/post-template.php on line 316

Warning: Cannot modify header information - headers already sent by (output started at /srv/users/vektropol/apps/vektropol/public/wp-includes/post-template.php:316) in /srv/users/vektropol/apps/vektropol/public/wp-admin/post.php on line 223

Warning: Cannot modify header information - headers already sent by (output started at /srv/users/vektropol/apps/vektropol/public/wp-includes/post-template.php:316) in /srv/users/vektropol/apps/vektropol/public/wp-includes/pluggable.php on line 1265

Warning: Cannot modify header information - headers already sent by (output started at /srv/users/vektropol/apps/vektropol/public/wp-includes/post-template.php:316) in /srv/users/vektropol/apps/vektropol/public/wp-includes/pluggable.php on line 1268

It does save the content (most of the time), but sometimes not. How do I fix it?

Hey @Kobber,

The countable warning is unlikely to cause issues. This is a result of using get_the_content WordPress function outside the loop, but according to this WordPress trac ticket it should be fine (and works in other PHP versions).

The headers already sent warning might be related to the saving issue, however, we couldn’t say if it’s really the builder having an issue or it’s the server or even a third-party plugin. Would you mind letting us know about the following:

  1. What’s the result when you deactivated all third-party plugins? Can you save successfully every time?
  2. What is your Memory Limit, Post Max Size, Time Limit, and Max Upload Size? You can go to X/Pro > Status to know those. If you have lots of plugins, you might need increase those server settings so please contact your web host to increase them to the max then test if you can save without issues.

-----------------------------------------------------------------------------------

It’s also a best practice to disable the display of errors in a live site. You can disable the error display by following the debugging documentation of WordPress here: https://wordpress.org/support/article/debugging-in-wordpress/

You can follow the example setup but please try to understand what each line of WordPress configuration does.

Thanks.

Hi Christian,

I can see that it’s only blog posts that gets the error, and I actually think that it started after I tried this: https://theme.co/apex/forum/t/blog-category-h1/68321/14

Hey @Kobber,

There’s only one way to find out if what was suggested is the cause and that is to revert the changes that was suggested and monitor if you can save the posts. If you can save the posts, this means that the suggestion is causing the issue.

I’d wonder why it will affect the posts though as the suggestion is for Category or Archive pages and not for Single Post. In this case also, regretfully, we need to wait for the Layout Builder so you won’t have to do what was suggested.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.