Forums

[resolved] Including code from files from a word press page (4 posts)

  1. LarryElterman
    Member
    Posted 2 years ago #

    I am trying to include html code located from another file from withing my word press environment while editing a page or post. Basically i want to use what programmers would call an "include" file, but i can not get it to work. I tried two different syntaxes both of which were ignored (not even an error message)

    <!--#include file="http://www.lifeandloveinthephilippines.com/ti/testit.html"-->

    <?php include("http://www.lifeandloveinthephilippines.com/ti/testit.html"); ?>

    Again, just to be clear, this code is from within word press while using the tinymce editor, and with the HTML tab selected so you see html code as upposed to wysiwyg.

    Can anybody tell me what im doing wrong or who to do this?

    Thanks.

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    If you are talking about placing code in a post or a page that you want executed when the post/page is rendered to a visitor then look at a plugin such as http://wordpress.org/extend/plugins/exec-php/

  3. LarryElterman
    Member
    Posted 2 years ago #

    Yes, MichaelH's answer was correct! although cryptic. For anyone coming across this post i will spell out the answer a little bit clearer.

    My code listed above was actually correct, namely

    <?php include("http://www.lifeandloveinthephilippines.com/ti/testit.html"); ?>

    but the reason it did not work was because you have to install the plugin suggested by michael to have php code exectued in your posts and pages

    Thanks michael

  4. MichaelH
    Volunteer
    Posted 2 years ago #

    You are welcome, I think ;)

Topic Closed

This topic has been closed to new replies.

About this Topic