WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] All PHP Rendering As HTML Comments (6 posts)

  1. Mike
    Member
    Posted 2 years ago #

    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.

  2. s_ha_dum
    Member
    Posted 2 years ago #

    Sounds like maybe you have a broken opening PHP tag. Do you have an URL for the site that I can see?

  3. shirazdrum
    Member
    Posted 2 years ago #

    Is php running on the server?

  4. s_ha_dum
    Member
    Posted 2 years ago #

    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.

  5. shirazdrum
    Member
    Posted 2 years ago #

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

  6. Mike
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.