Title: Calling WordPress PHP functions elsewhere on site
Last modified: August 18, 2016

---

# Calling WordPress PHP functions elsewhere on site

 *  [dazburn](https://wordpress.org/support/users/dazburn/)
 * (@dazburn)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/calling-wordpress-php-functions-elsewhere-on-site/)
 * Hi all,
 * Quick question. My WordPress installation resides at [http://www.janet-love.com/news](http://www.janet-love.com/news)
 * However, other files reside in the root of [http://www.janet-love.com](http://www.janet-love.com)
   and also subdirectories of the site. Basically I have a script in [http://www.janet-love.com/scriptname/subdirectory](http://www.janet-love.com/scriptname/subdirectory)
   let’s say. I can customise the header and footer of that script as well to integrate
   with the site layout.
 * However, I want to be able to call on WordPress PHP (such as the calendar), the
   sidebar etc, so that they appear on that page too.
 * Obviously I can just insert <?php get_sidebar(); ?> but that doesn’t get processed
   if the files aren’t in the WordPress directory. And before you ask…this script
   is too complicated to integrate into a WordPress page.
 * How do I do that? Hope I’ve made myself clear as I appreciate it’s a tricky situation
   to explain.
 * Any help would be much appreciated!

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

 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/calling-wordpress-php-functions-elsewhere-on-site/#post-406361)
 * It’s easy 🙂
 * First, the other pages must be .php but you probably know that.
 * Second, you need wp-blog-header.php as that is the file that does all the work.
   So if you include that in your header all will be good
 * <?php include(‘path/to/wp-blog-header.php’); ?>
 *  [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/calling-wordpress-php-functions-elsewhere-on-site/#post-406364)
 * I struggled with this problem for a loooooong time. See this post for an example
   of exactly what you need to add:
    [http://wordpress.org/support/topic/60829?replies=7](http://wordpress.org/support/topic/60829?replies=7)
 *  Thread Starter [dazburn](https://wordpress.org/support/users/dazburn/)
 * (@dazburn)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/calling-wordpress-php-functions-elsewhere-on-site/#post-406464)
 * thank you so much!
 * one more quetsion tho…i also use the 4images RANDOM image function and it poses
   a problem for some reason…look at [http://www.janet-love.com/mail/signup](http://www.janet-love.com/mail/signup)
 * any ideas?

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

The topic ‘Calling WordPress PHP functions elsewhere on site’ is closed to new replies.

## Tags

 * [calendar](https://wordpress.org/support/topic-tag/calendar/)
 * [call](https://wordpress.org/support/topic-tag/call/)
 * [directories](https://wordpress.org/support/topic-tag/directories/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [other](https://wordpress.org/support/topic-tag/other/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [templates](https://wordpress.org/support/topic-tag/templates/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)

 * 3 replies
 * 3 participants
 * Last reply from: [dazburn](https://wordpress.org/support/users/dazburn/)
 * Last activity: [19 years, 11 months ago](https://wordpress.org/support/topic/calling-wordpress-php-functions-elsewhere-on-site/#post-406464)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
