Title: Different location for php include file
Last modified: August 19, 2016

---

# Different location for php include file

 *  [jacqueschoquette](https://wordpress.org/support/users/jacqueschoquette/)
 * (@jacqueschoquette)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/different-location-for-php-include-file/)
 * 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 2 replies - 1 through 2 (of 2 total)

 *  [converting2wp](https://wordpress.org/support/users/converting2wp/)
 * (@converting2wp)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/different-location-for-php-include-file/#post-1566521)
 * TEMPLATEPATH and ABSPATH are WordPress symbolic constants which, as you’ve discovered,
   expand to the current theme directory and to the root of the WordPress install.
   If you don’t want to put your includes directory there, you need to change the
   path that you give to the PHP include function to be the path on the server to
   the directory. So maybe
 * `include ('/home/mylogin/public_html/includes/test-include.php');`
 * If you want to make the path “portable”, you can use one of the PHP variables
   for this:
 * `include($_SERVER['DOCUMENT_ROOT'].'/includes/test-include.php');`
 *  Thread Starter [jacqueschoquette](https://wordpress.org/support/users/jacqueschoquette/)
 * (@jacqueschoquette)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/different-location-for-php-include-file/#post-1566527)
 * Awsome thanks for taking the time to answer my newbie questions. It is greatly
   appreciated

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

The topic ‘Different location for php include file’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [jacqueschoquette](https://wordpress.org/support/users/jacqueschoquette/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/different-location-for-php-include-file/#post-1566527)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
