Include It

Include It is a plugin that permits the inclusion, in a post or in a page, of any type of file (even a php script that will be executed).

I use it to write some functionalities needed in some pages, without creating specific template pages (that are theme dependant) and without using a “php code executor”.

The plugin has no options to set, but may be you would have some infos on how to use it. So, read on…

How to use

The plugin let you to include in a page or in a post whatever file in you web server: text, html or even php (that will be executed!). In the examples there is a space between the first square bracket and the word “include”: remove it if your are copying this pieces of code.

To include a file, write down in the post or page this “quick tag”:

[ include file=filename]

where the “filename” is a relative path to the file to include. The file system path to your blog “root” is automatically added.

Example. If you write:

[ include file=license.txt]

the file “license.txt” of the WordPress distribution you are using will be included in the post or page.

Advanced usage

If you need your inclusion to be showed in a iframe, you can! Just add some attributes to the include tag, like in this
example:

[ include file=license.txt iframe=true width=90% height=300]

height and width are optional. If not set they won’t be specified. The iframe “frameborder” will be set to 0 (hidden). If the file specified starts with “http://”, it will e used “as is” in the “src” attribute of the iframe. If not, the blog home url will be added to the file.

Why to use this plugin?

If you want to use the rich text editor (TinyMCE) and you want to put in the post some special code, this way grants the code to be inserted without modification. Or if you want to write a service (like a calculator or someting else) written in php, you can embed such a service in a normal WordPress page, inheriting graphic, css and the overall blog environement.

Download

The plugin is availiable on WordPress Plugins Repository on this page. Sorry to all people who kindly claimed for not finding a download link.

  1. April 10th, 2008 at 06:46 | #1

    “scrolling=no”
    i want show scrolling=no

  2. April 10th, 2008 at 08:25 | #2

    As soon as i add those attributes!

  3. Lionel Chollet
    May 9th, 2008 at 15:51 | #3

    Hello and thanks for this plugin.

    Is it possible to include two different files in one post (for example: one before the post content, and one after the post content)?

    I couldn’t make it work on my own — the second inclusion displays as [include file =filename] –, but I’m a total newbie at code, and hopefully a more knowledgeable person knows how to do this…

  4. June 2nd, 2008 at 22:01 | #4

    Hi. I want to include a bloglog profile widget in my “about” page and I’m pretty sure it can be done with this plugin. Can you show me how I could do it?

    Thanks.

  5. June 6th, 2008 at 12:16 | #5

    Hi Pablo,

    You can add any type of link using this plugin.
    let say you want to add this link
    http://www.naseerahmad.com/services/
    just use the following code
    [include file=http://www.naseerahmad.com/services]

    I hope you understand this.
    regards,

  6. June 6th, 2008 at 15:45 | #6

    What if I wanted to include this:

  7. Pablo Alvestegui
    June 6th, 2008 at 16:01 | #7

    I don’t know if you got my previous message. I wanted to know if this type of code can be included:

    (((())))))

  8. June 7th, 2008 at 12:10 | #8

    Can you please send me more details on this, in order to understand your questions?

    regards,
    Naseer

  9. June 24th, 2008 at 13:07 | #9

    This doesn’t work in sidebar widgets as far as I can tell, which is where I needed to use it. Do you have any ideas on how to make it work there as well?

  10. Tim
    June 29th, 2008 at 01:32 | #10

    Your pugin works but my pages will not validate.
    A tag shows up in the XHTML just in front of the
    included code.

    Any idea why this is happening?

    When I just past the code into tinymce the problem goes away.

  11. July 8th, 2008 at 15:37 | #11

    Hi, cool plugin, i needed it so much, thanks!

    Sometimes it would be nice to have some more attribute in iframes, like allowtransparency=”true”. (Crap IE doesn’t make transparent iframe unless this is set :( )

    Best regards.

  12. July 8th, 2008 at 21:42 | #12

    If you really need to use all the iframe’s attributes, why not write the iframe tag directly in the page or post? You only need to use the editor in “html” mode (an avoid to do subsequent editing in “visual” mode).

  13. goran
    August 4th, 2008 at 22:00 | #13

    Nice plugin!
    When can we expect version compatible with WP 2.6

  14. mickey
    September 10th, 2008 at 22:22 | #14

    Its not compatible with WP 2.6? I really could use this plugin.

  15. September 11th, 2008 at 11:40 | #15

    I’ve not already tried it on wp 2.6, but i’m pretty sure it’s compatible… just try it cannot hurt… I hope!

  16. Toni Ann
    September 18th, 2008 at 05:55 | #16

    I have Wordpress 2.6 but the plugin does not work.. it keeps starting from the /home/content/ directory.. and says failed to open stream: No such file or directory . :-(. can someone help?

  17. Toni Ann
    September 18th, 2008 at 05:58 | #17

    I have Wordpress 2.6 but the plugin does not work.. it keeps starting from the /home/content/ directory.. and says failed to open stream: No such file or directory . :-(. can someone help?

    Thanks so Much Toni Ann :-)

  18. goran
    September 19th, 2008 at 09:31 | #18

    Yes, it’s compatible, works perfectly!

    Thanks!

  19. September 19th, 2008 at 17:53 | #19

    I also confirm it works with 2.6.2, but I have small problem.

    Whatever I include it is placed between tags so css formatting of the contents does not work.

  20. September 28th, 2008 at 09:49 | #20

    “I have Wordpress 2.6 but the plugin does not work.. it keeps starting from the /home/content/ directory.. and says failed to open stream: No such file or directory . :-(. can someone help?”

    I get the same problem. Admin can you check your code? Including webpages doesn’t seem to work on WP2.6

  21. kevin
    October 1st, 2008 at 15:02 | #21

    i am trying to display a page/sub directory (mydomain.com/mypage) but it kicks out an error:

    failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\wp-content\plugins\include-it\plugin.php on line 86

    is there a way around this?

  22. Michiel
    October 5th, 2008 at 12:38 | #22

    Same here. can’t include webpages

  23. May 17th, 2009 at 06:27 | #23

    Is it possible to upload a software and work with it through the website? For example excel?

  1. No trackbacks yet.