0

I have a very basic question.

In the functions.php file of a theme, what happens to the text that is outside a function and outside the <?php ?> tags? Can I place notes before and after the functions without commenting it and without affecting the system? Or should I at least enclose the out-of-php text in html comments?

For example:

comment/note/reference text
<?php
function my_function() {
code;
return results;
}
?>
more comment/note/reference text
<?php
function my_function_2() {
code;
return results;
}
?>
more comment/note/reference text

cheers,
Gregory

1 Answer 1

2

It will probably throw a 'Headers already sent' error/warning and cause a lot of trouble to everything.

3
  • You're welcome! If my answer helped you, please accept it as the correct answer! Commented Apr 28, 2012 at 10:48
  • just saw your answer in action, even with html commented text before the first function. cheers.
    – Gregory
    Commented Apr 28, 2012 at 12:41
  • No problem mate! It's good you asked, cuz that error is a heck of a pain in the neck! Cheers! :) Commented Apr 28, 2012 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.