Title: using a php file include in multiple multisite sites
Last modified: August 20, 2016

---

# using a php file include in multiple multisite sites

 *  Resolved [lisagetcwscom](https://wordpress.org/support/users/lisagetcwscom/)
 * (@lisagetcwscom)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/using-a-php-file-include-in-multiple-multisite-sites/)
 * Working with WP Multisite for one customer with 9 locations (and individual sites)
   and growing. I wanted to use an include to pull in the Locations (a google map
   plus list of locations) into each site’s individual Locations page. I can’t get
   the include to work (i can get it to work using iFrame, but well, I don’t want
   to use iframe, rather use an include. WordPress seems to ignore the include. 
   I’m running a child theme of 2011.
 * Any suggestions? Here’s the page I want to “include”: [http://twomaidsandamop.com/map/index.php](http://twomaidsandamop.com/map/index.php)
 * and here’s the page I want to “include” it on: [http://greensboro.twomaidsandamop.com/location/](http://greensboro.twomaidsandamop.com/location/)
 * and the code I’ve tried using is `<?php include("http://twomaidsandamop.com/map/
   index.php"); ?>`
 * I know just enough to be dangerous, and appreciate any help provided.

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

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 8 months ago](https://wordpress.org/support/topic/using-a-php-file-include-in-multiple-multisite-sites/#post-3068971)
 * You generally can’t run PHP includes in a WP page (security).
 * You could do this with a page template, make a ‘page-location.php’ template that
   uses the php code.
 *  Thread Starter [lisagetcwscom](https://wordpress.org/support/users/lisagetcwscom/)
 * (@lisagetcwscom)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/using-a-php-file-include-in-multiple-multisite-sites/#post-3069123)
 * It’s still ignoring the include call. I added “abcdefg” into the template file
   and it displays the text, but ignores the include.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 8 months ago](https://wordpress.org/support/topic/using-a-php-file-include-in-multiple-multisite-sites/#post-3069128)
 * That would be because youre not using include right.
 * [http://php.net/manual/en/function.include.php](http://php.net/manual/en/function.include.php)
 * `include(/full/path/to/map/index.php);`
 * Possibly `include 'http://www.example.com/file.php?foo=1&bar=2';` woudl work,
   but I’ve never tried it.
 *  Thread Starter [lisagetcwscom](https://wordpress.org/support/users/lisagetcwscom/)
 * (@lisagetcwscom)
 * [13 years ago](https://wordpress.org/support/topic/using-a-php-file-include-in-multiple-multisite-sites/#post-3069220)
 * I did find a solution, and here is what worked:
 *     ```
       <?php
          $path = $_SERVER['DOCUMENT_ROOT'];
          $path .= "/includes/locations.txt";
          include_once($path);
       ?>
       ```
   
 * I placed this code in a template file (where the page content would be) and used
   the template when I wanted to display the data inside the locations.txt file.

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

The topic ‘using a php file include in multiple multisite sites’ is closed to new
replies.

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 4 replies
 * 2 participants
 * Last reply from: [lisagetcwscom](https://wordpress.org/support/users/lisagetcwscom/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/using-a-php-file-include-in-multiple-multisite-sites/#post-3069220)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
