Title: PHP include file from outside theme folder
Last modified: August 19, 2016

---

# PHP include file from outside theme folder

 *  [jacqueschoquette](https://wordpress.org/support/users/jacqueschoquette/)
 * (@jacqueschoquette)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/php-include-file-from-outside-theme-folder/)
 * Hi everyone I am new to wordpress and php
 * I have wordpress installed on my site in a subdirecoty called [http://www.sitename.com/blog/](http://www.sitename.com/blog/)
 * I am trying to include a file outside of the blog folder
 * [http://www.sitename.com/includes/test-include.php](http://www.sitename.com/includes/test-include.php)
 * using
 * <?php include( TEMPLATEPATH . ‘/includes/test-include.php’ ); ?>
 * However this does not work. If I put the folder includes into my theme folder
   the it does work
 * I also tried
 * <?php include(ABSPATH . ‘/includes/test-include.php’); ?>
 * but that does not work either
 * Can you include a file in your templates from outside the wordpress install folder?
 * I am thinking a virtual directory to /includes/ created in the blog folder would
   do the trick but there should be a better way no?
 * I am on wordpress 3 php 5 on iis 6
 * please help

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

 *  Thread Starter [jacqueschoquette](https://wordpress.org/support/users/jacqueschoquette/)
 * (@jacqueschoquette)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/php-include-file-from-outside-theme-folder/#post-1565791)
 * oops posted twice for some reason
 *  [philgreen](https://wordpress.org/support/users/philgreen/)
 * (@philgreen)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-include-file-from-outside-theme-folder/#post-1566151)
 * I’m trying to do the same thing. Let me know if you figure out how to do this.
 *  [vinnyred](https://wordpress.org/support/users/vinnyred/)
 * (@vinnyred)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/php-include-file-from-outside-theme-folder/#post-1566163)
 * You would have to use an absolute path from the root of your web server. I’m 
   looking to do the same thing and there’s no tidy way of doing it. when you use
   the TEMPLATE include it refers to a folder in your theme directory. Therefore,
   if you place your includes folder in your theme folder it will work. The only
   thing you will then have to do is refernce the include on your main site from
   your theme folder in wordpress.
 *  [vivsin](https://wordpress.org/support/users/vivsin/)
 * (@vivsin)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/php-include-file-from-outside-theme-folder/#post-1566174)
 * include normally
 * like
    `<?php include_once('includethis.php'); ?>`
 * where includethis.php is inside theme directory (alongwith other theme files)

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

The topic ‘PHP include file from outside theme folder’ is closed to new replies.

## Tags

 * [templates](https://wordpress.org/support/topic-tag/templates/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 4 participants
 * Last reply from: [vivsin](https://wordpress.org/support/users/vivsin/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/php-include-file-from-outside-theme-folder/#post-1566174)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
