wordpress includes code question

by webgal
1 replies
Greetings,

I am needing some help with the following problem in wordpress.

1. I can succesfully include a file using the exec-php plugin in a wordpress post if the file is in the same directory on on the same server.

IE: <?php include(ABSPATH . "banner.php"); ?>
This sample works just fine in my wordpress template

2. My problem arises, when I try to include a url from an external website into my wordpress template ie:

Instead of banner.php I want to include something like www.sitename.com/url-goes-here/

Anyone know the proper code to use to include a file from an external site in a wordpress blog?
#code #includes #question #wordpress
  • Profile picture of the author floatingatoll
    Originally Posted by webgal View Post

    Greetings,
    IE: <?php include(ABSPATH . "banner.php"); ?>
    This sample works just fine in my wordpress template

    2. My problem arises, when I try to include a url from an external website into my wordpress template ie:

    Instead of banner.php I want to include something like

    Anyone know the proper code to use to include a file from an external site in a wordpress blog?
    If you enable the "allow_url_fopen" parameter in php.ini, then you can pass URLs to include() instead of filenames, with optional arguments. Search the PHP documentation for "include() through HTTP" for more details. (I'd post an example, but I'm not allowed to by the forum filters.)
    {{ DiscussionBoard.errors[281579].message }}

Trending Topics