"headers already sent" warning after activating my new plugin [duplicate]

  css, php, plugins, wordpress

I am trying to create a simple wordpress plugin but when I activated it, the screen shows the message:

"The plugin generated 58 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin."

I have troubleshoot and found that the cause is the following line on top of the file:

echo "<link rel='stylesheet' type='text/css' href='style.css' />";
If I removed this css embedding line, then the warning will not show. But how can I still embed this css style file for my plugin?

Any help is much appreciated, thank you!

Source: Ask PHP

LEAVE A COMMENT