0

I am trying to insert a CSS code inside the php file itself. But I am encountering with an error continuously when even I update my post. Error is:

Cannot modify header information - headers already sent by (output started at bla bla on line 32) in /home/bla bla/wp-admin/post.php on line 235

Below is the code I am adding inside my php file:

echo "<link rel='stylesheet' type='text/css' href='style.css' />";
echo    "<style>
        div#cuzd-dispatch-general-v {
            display: none;                  
            }
        </style>";
Athar K
  • 191
  • 3
  • 18
  • Might get you somewhere: https://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F – Naoto Ida May 26 '15 at 07:05
  • Please edit your question and post the `bla bla` file, lines 29-35 ish – rnevius May 26 '15 at 07:52

2 Answers2

0

in the file post.php, place all your above code below all the header functions that are being used in the post.php function, because header() function works only when nothing is echoed in php.

Sourabh Kumar Sharma
  • 2,864
  • 3
  • 25
  • 33
-1

The error that Wordpress is giving you is because you are trying to add header content (what must go inside the <head></head>) inside the <body></body>

You must insert this code before "output started at bla bla on line 32". Otherwise, WP will be trowing you this error.

Kyto
  • 181
  • 3
  • 12