WordPress.org

Ready to get started?Download WordPress

Forums

embed page within wp page? (9 posts)

  1. oncidium
    Member
    Posted 7 years ago #

    I've been searching for a solution to this and playing around but haven't been able to solve it yet. I'd like for this page: http://www.divaknitting.com/gallery (snipe gallery) to display on a wp page: http://www.divaknitting.com/blog/?page_id=334

    I thought maybe I could use the index.php code from the snipe gallery page on the wp page, but I get all kinds of erros in the php when I try to run it. An example: Warning: Unknown(inc/config.php): failed to open stream: No such file or directory in .../public_html/blog/wp-content/plugins/runPHP/runPHP.php(383) : eval()’d code on line 16

    I tried switchin to absolute refs for the file it was trying to call but that didn't work either. Any ideas on how I can get this to work?

  2. oncidium
    Member
    Posted 7 years ago #

    sorry...trying to reply to a different post

  3. mikeatvillage
    Member
    Posted 6 years ago #

    Hi,

    I'm trying to do something similar. I'd like to embed a page (curren.php) from my website in a post or page of my blog.

    I tried

    <?php
    include ("../current.php");
    ?>

    but that just resulted in the above text being displayed.

    Any ideas ?

  4. moshu
    Member
    Posted 6 years ago #

    You can NOT use PHP code in the content of a post or Page, unless you have installed a plugin that will allow to run PHP code.

  5. mikeatvillage
    Member
    Posted 6 years ago #

    Many thanks Moshu,

    I'm trying a plugin now named "embed-it" but that's not giving me the required results either. Do you know of a plugin that should work for me ?

    ATB

    Mike

  6. Adam Brown
    Member
    Posted 6 years ago #

    I'm trying a plugin now named "embed-it" but that's not giving me the required results either.

    What do you mean? Does it not process the code, or is the PHP incorrect?

    My hunch is that your PHP is incorrect. Try using an absolute path instead of ../current.php.

  7. mikeatvillage
    Member
    Posted 6 years ago #

    Thanks Adam,

    When I tried "embed-it" I actually inserted code and not just an include.

    I'm just about to try another plugin "runPHP" to see if that's what I need.

    ATB

    Mike

  8. mikeatvillage
    Member
    Posted 6 years ago #

    runPHP seems to work OK :-)

    now I'm trying to run mySQL queries to populate the table which the php is creating.... maybe I'm expecting too much lol

    Mike

  9. mikeatvillage
    Member
    Posted 6 years ago #

    exec_php is allowing me to embed php and mySQL into my posts, great :-)

Topic Closed

This topic has been closed to new replies.

About this Topic