"Cannot modify header information" Error
-
I was running into this problem when trying to view or download files:
Warning: Cannot modify header information – headers already sent by (output started at /home/public_html/wp-head.php:37) in /home/public_html/wp-content/plugins/wp-publication-archive/lib/class.wp-publication-archive.php on line 199
For those having the same issue, I was able to fix it by adding the following code to my functions.php file:
//allow redirection, even if my theme starts to send output to the browser add_action('init', 'do_output_buffer'); function do_output_buffer() { ob_start(); }
For the full explanation of why this works, view this StackOverflow article here:
Hope this saves someone else some trouble!
https://www.ads-software.com/plugins/wp-publication-archive/
- The topic ‘"Cannot modify header information" Error’ is closed to new replies.