PHP code shown in the browser
-
I am a newbie to WordPress development, and PHP, so my problem is maybe a dummy error. Anyway, I have created a child theme to the Twenty Eleven theme as suggested as the smart way for customization of a theme and the customization I want to do is to hide the website field in comments.
So I added this code (full file shown) to functions.php in the child theme folder
<?php add_filter('comment_form_default_fields', 'url_filtered'); function url_filtered($fields) { if(isset($fields['url'])) unset($fields['url']); return $fields; } ?>And it works. The website field is hidden. But the PHP code is shown as one long unindented line of text in the top of pages that contains the comments form. Are there any simple explanation to this?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘PHP code shown in the browser’ is closed to new replies.