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.
Please use the support forum to ask questions.
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 you can use Include Me with the shortcode:
[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 (so you can include files even external of the site root folder).
Generating an iframe
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:
[[ncludeme 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.
Passing variables
If you include a PHP script, it can access the shortcode attributes using the syntax $attrs[[attribute name’]]. For example calling:
[includeme file="out.php" value="My name is Stefano"]
and with out.php
|
1 2 3 |
<?php echo $attrs['value']; ?> |
The output will be, of course “My name is Stefano”. So you can create a generic script and make it doing different things using the shortcode attributes.

