Twenty Eleven
Is it the theme or the WP HTML editor that is causing php incude problem? (3 posts)

  1. sleeplessinDC
    Posted 3 years ago #

    In Twenty Eleven, I am using the WordPress HTML editor to add a php includes in a page. I type

        include 'somefile.inc.php';

    and save the draft. When I preview the page in Twenty Eleven, the code shows as text. When I go bak to the HTML I find that a space has been inserted in front of the question mark < ?php, making it invalid.

    I can't figure out why--is it the HTML editor or the theme that is doing this?


  2. Andrew Nevins
    Forum moderator
    Posted 3 years ago #

    The HTML editor can only parse HTML, not PHP.

    You may need to create a Child Theme and work off the files within that Child Theme.

  3. sleeplessinDC
    Posted 3 years ago #

    Thanks. I've read the information about child themes and created one that helps me with some other things, but it doesn't tell me how to include php include files on a page. I found a plugin that said it would do it with [include]filename.php[/include] but that didn't work either. (I'd put an includes folder in the child theme and used that path to the file, but it couldn't find the file.)

    Plugging onward.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic