Include Me

Include Me is a powerful plugin that lets you to include in any post or page and external HTML or PHP file. For PHP files, they will be executed and their output included, so you can develop indipendent scripts that can be made available on posts or pages.

An example? You want to publish a report generated by some queries on a database. Just develop such script and make it to output an HTML fragment. Then include it on a page with Include Me.

Example two. You want a dedicated page with your Facebook Fan Page widget (which is made of Javascript). Just create a textual file with Facebook widget code and include it with Include Me.

Where is the advantage over developing a theme custom page? Let me answer with another question: what happens to theme custom pages when you change theme?

Include Me syntax

In any post or page Include Me is activate with a short code (without spaces between “[" and "includeme" word):

[ includeme file="filename"]

where the “file” attribute contains the filename to be included. Any textual file can be included and if it is a PHP file (with “.php” extension) it will be executed and its output included.

The filename can be relative (not starting with “/”) so it will be searched starting from the blog root folder (for technicians, ABSPATH will be added at the beginning). If the filename is absolute (starting with “/”) it will be used as is.

A second syntax is available and generate an iframe instead to include the file. The iframe syntax is:

[ includeme src="url"]

where “url” is a common web address. Any other attribute added to the short tag will be used as an iframe attribute. For example if you write:

[ includeme src="http://www.example.com" frameborder="0" width="500" height="400"]

the result will be

<iframe src=”http://www.example.com” frameborder=”0″ width=”500″ height=”400″></iframe>

Nice, isn’t it?

I widely used this plugin (and its old and incompatible version Include It) on my blogs.

by Stefano Lissa

11 thoughts on “Include Me

  1. Owen

    I’d like it to generate a value for the default value of an INPUT tag, but it doesn’t work (the field value just becomes [includeme = ). When I use TEXTAREA it’s fine. Any workarounds?

    Reply
  2. Pingback: Wordpress….i migliori plugin scelti dalla redazione - MoooLink

  3. rei

    Is is very good but it is changing my css.

    I was writing the same instruction again and again in different post, so i would like to extract the instruction part into different file, where i could just [includeme] with it.
    Everything works fine, but the wordings font and size were all changed..

    Anyway to fix it?

    Thank you.

    Reply
  4. Javier

    What are the advantages of Include me over Include it?

    I am a current include it user and i am very satisfied with it.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>