Forums

[resolved] Can I use php INCLUDE statement in a page? (14 posts)

  1. twebman
    Member
    Posted 2 years ago #

    I've installed php exec plugin, which is supposed to allow me to use PHP within the content of my pages/posts.

    However, I can't seem to be able to include a file using PHP. When I place this code: <?php include("myfile.php"); ?> inside the <phpcode> tags, the text itself shows up, not the file I'm trying to include.

    I've tried the file path, but that's not what's breaking this. It appears to be something else.

    Any ideas? Is there another method for including an external file on a page?

  2. You could try page templates.

  3. twebman
    Member
    Posted 2 years ago #

    Thanks, but it appears that the theme I'm using (Atahualpa) does not support page templates. Can anyone confirm this?

  4. http://wordpress.bytesforall.com/?p=67 - Seems to imply that it does fine with Templates.

  5. MichaelH
    Volunteer
    Posted 2 years ago #

    twebman - can you provide a link to the php exec plugin you are using. Thanks.

  6. twebman
    Member
    Posted 2 years ago #

  7. twebman
    Member
    Posted 2 years ago #

    Ipstenu - when Atahualpa is enabled as the theme, there is no template drop-down menu on the Post/Page edit screens. When I switch to default or classic themes, the drop-down returns.

  8. MichaelH
    Volunteer
    Posted 2 years ago #

  9. MichaelH
    Volunteer
    Posted 2 years ago #

    Also might look at this plugin:
    http://wordpress.org/extend/plugins/exec-php/

  10. twebman
    Member
    Posted 2 years ago #

    FYI - I've done more research into this, for those who may confront this same issue.

    Atahualpa theme DOES NOT allow different templates to be used within pages or posts. The menu doesn't even show up when using this theme. It's not a bug, I switched to other themes, and they support themes just fine. The way Atahualpa is built, it uses the one template.

    Also, when running Atahualpa, exec-php DOES allow me to use the PHP include statement in widgets on the sidebars BUT NOT in the center or main portion of the page. It breaks the entire template. This is because of the way Atahualpa is coded on the index.php page.

    I'm planning to look at hacking that when I have time, but I'm busy on other projects first.

    Thanks to all for their input.

  11. MichaelH
    Volunteer
    Posted 2 years ago #

    Atahualpa theme DOES NOT allow different templates to be used within pages or posts.

    Just created a Page and assigned a Template to that Page and it worked just fine with Atahualpa. Maybe I'm missing something...

  12. twebman
    Member
    Posted 2 years ago #

    Hmmm.... Michael, I don't see a template selection on the create a page screen in Atahualpa. What am I missing?

  13. MichaelH
    Volunteer
    Posted 2 years ago #

    You don't have a template that has the proper structure.

    See the FAQ, Why is there no Page Template option when writing or editing a Page?

  14. twebman
    Member
    Posted 2 years ago #

    That was it! Thanks, Michael.

Topic Closed

This topic has been closed to new replies.

About this Topic