Title: Include a php file
Last modified: August 31, 2016

---

# Include a php file

 *  Resolved [jerseygirl](https://wordpress.org/support/users/jerseygirl/)
 * (@jerseygirl)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/include-a-php-file-1/)
 * Hi, can I use this plugin to do the following on a page on my Word Press site?
 * <!–#include virtual=”../services/lulu.php” –>
 * I need a plugin that can do this!
 * [https://wordpress.org/plugins/php-code-for-posts/](https://wordpress.org/plugins/php-code-for-posts/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [tazir](https://wordpress.org/support/users/tazir/)
 * (@tazir)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/include-a-php-file-1/#post-7118966)
 * you can create such plugin by yourself: [http://www.sitepoint.com/how-to-develop-a-php-file-include-plugin-for-wordpress/](http://www.sitepoint.com/how-to-develop-a-php-file-include-plugin-for-wordpress/)
 *  Plugin Author [Jamie Fraser](https://wordpress.org/support/users/thejfraser/)
 * (@thejfraser)
 * [10 years ago](https://wordpress.org/support/topic/include-a-php-file-1/#post-7119168)
 * Hi Jerseygirl
 * You could create a snippet that does the following:
 * `<?php include('/path/to/your/file.php'); ?>`
 * Then place the shortcode into your post or page where you want to include it.
 *  [mekeri](https://wordpress.org/support/users/mekeri/)
 * (@mekeri)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/include-a-php-file-1/#post-7119210)
 * Hey Mr. Fraser! I wanted to piggyback on this question with a similar one. I’m
   trying to include a block of code. I wanted to make it an include because I’m
   probably going to be using it in various places. My problem is figuring out what
   to put for the ‘/path/to/your/file.php’
 * I’m new to wordpress and the way it handles file pathing is still new to me. 
   I have a php file named newsCalWidget.php and it’s in my root theme folder. so…
 * wp-content/themese/StemWP/newsCalWidget.php
 * any help here would be fantastic!! Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Include a php file’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/php-code-for-posts_0d1022.svg)
 * [PHP Code for posts](https://wordpress.org/plugins/php-code-for-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-code-for-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-code-for-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/php-code-for-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-code-for-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-code-for-posts/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [mekeri](https://wordpress.org/support/users/mekeri/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/include-a-php-file-1/#post-7119210)
 * Status: resolved