WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] All PHP Rendering As HTML Comments

[Resolved] All PHP Rendering As HTML Comments

  • Mike
    Member

    @fsartistgmailcom

    I copied a working theme (making an overhaul).. and made nominal changes. Now, when viewing the index, all php code shows up as html comments… for example

    <?php get_header(); ?>

    which is the first line of code on index.php, shows up as this when loading the website:

    <!--?php get_header(); ?-->

    Anyone have a clue what is causing this? All php blocks of <?php ?> get reformatted into this html comment format, causing the entire website to be blank.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Sounds like maybe you have a broken opening PHP tag. Do you have an URL for the site that I can see?

    shirazdrum
    Member

    @shirazdrum

    Is php running on the server?

    Is php running on the server?

    Good question. I assumed it was because copying a working theme and making nominal changes just prior to the failure. Its worth checking though.

    shirazdrum
    Member

    @shirazdrum

    Is there a link to this site? Does it happen only on the index or all pages?

    Mike
    Member

    @fsartistgmailcom

    It was only happening on index. I though the same thing (in regards to broken block), but it was happening from line 1. The file was definitely a php file running in WP, and I checked the permissions (644).

    I eventually determined that the file was corrupted. Made a new index.php and pasted in the same code, worked fine.

    I’ve never seen a corrupted file do that, but good to know.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] All PHP Rendering As HTML Comments’ is closed to new replies.