Support » Theme: Twenty Eleven » [Theme: Twenty Eleven] Is it the theme or the WP HTML editor that is causing php incude problem?

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

    <?php
        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?

    http://wordpress.org/extend/themes/twentyeleven/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    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.

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Theme: Twenty Eleven] Is it the theme or the WP HTML editor that is causing php incude problem?’ is closed to new replies.