Title: Include File
Last modified: August 21, 2016

---

# Include File

 *  Resolved [avay](https://wordpress.org/support/users/avay/)
 * (@avay)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/include-file/)
 * I have made a file in “**/wp-content/themes/mytheme/inc/slider.php**“
    Now I 
   want to include the file in index.php. I tried with include_once `include_once
   get_template_directory_uri()."inc/slider.php";` but I get following error :
 * > Warning: include_once(): http:// wrapper is disabled in the server configuration
   > by allow_url_include=0
 * Can you please tell the best way to include a file placed inside a theme?

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

 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/include-file/#post-3887638)
 * Try this:
 *     ```
       include_once WP_CONTENT_DIR . '/themes/mytheme/inc/slider.php';
       ```
   
 *  Thread Starter [avay](https://wordpress.org/support/users/avay/)
 * (@avay)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/include-file/#post-3887666)
 * Thank you Josh for the suggestion. I tried following your hint
 * > include_once WP_CONTENT_DIR.”/themes/dfm/inc/slider.php”;
 * but I couldn’t get the result, slider could not be seen.
 *  Thread Starter [avay](https://wordpress.org/support/users/avay/)
 * (@avay)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/include-file/#post-3887812)
 * I used
 * > include_once TEMPLATEPATH.”/inc/slider.php”;
 * it worked..

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

The topic ‘Include File’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [avay](https://wordpress.org/support/users/avay/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/include-file/#post-3887812)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
