Title: Calling php onto a static page
Last modified: August 18, 2016

---

# Calling php onto a static page

 *  Resolved [Christiaan](https://wordpress.org/support/users/christiaan/)
 * (@christiaan)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/)
 * I’m trying to setup a splash page at /index.html (while my WordPress files reside
   at /blog )
 * I’ve been following the instructions on [http://codex.wordpress.org/Creating_a_Static_Front_Page](http://codex.wordpress.org/Creating_a_Static_Front_Page)
 * But I can’t even get started. I put the following text only in my root index.
   html file:
 * <?php define(‘WP_USE_THEMES’, false);
    require(‘blog/wp-blog-header.php’); ?>
 * But all I get is a blank page (as of writing this):
    [http://last-straw.net/](http://last-straw.net/)
 * Any pointers?

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

 *  [thegreatnorth](https://wordpress.org/support/users/thegreatnorth/)
 * (@thegreatnorth)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283064)
 * Try renaming your file from index.html to index.php
    PHP can’t run in a html 
   document without some type of special server and htaccess settings.
 *  Thread Starter [Christiaan](https://wordpress.org/support/users/christiaan/)
 * (@christiaan)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283532)
 * Still get a blank page. And not only that if I try to view the page source of/
   index.php in my web browser it appears blank, when it’s not as far as my FTP 
   app and Dreamweaver are concerned.
 *  [kickass](https://wordpress.org/support/users/kickass/)
 * (@kickass)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283534)
 * The “creating a static front page” instructions are meant to make a WordPress
   Page become the homepage of the blog portion of your website. However, if your
   blog doesn’t reside in your toplevel directory it can’t “create” the index page
   of your site unless you do some .htaccess magic or somesuch.
 * What you CAN do is call in parts of your blog into your static homepage. Instructions
   here:
    [http://wordpress.org/support/topic/45242](http://wordpress.org/support/topic/45242)
 * See it in action here, in the right side column:
    [http://kickasswebdesign.com](http://kickasswebdesign.com)
 * One caveat– if you’re already indexed in the search engines for yourdomain.com/
   index.html and you change the page to yourdomain.com/index.php you will LOSE 
   your SE ranking. There is a way to change the .htaccess so that php will be recognized
   in pages that have .htm and .html extensions. If the site is new and not really
   recognized yet it won’t matter.
 *  Thread Starter [Christiaan](https://wordpress.org/support/users/christiaan/)
 * (@christiaan)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283563)
 * Still get a blank page. kickass, the thread you point to doesn’t appear to give
   different advice to what I’ve already done. Yes I’m trying to call parts of my
   blog to my root index page. I’ve tried this code, as per the thread you pointed
   to:
 * `<?php
    require_once("blog/wp-blog-header.php"); define('WP_USE_THEMES', false);?
   >
 * But it’s still showing a blank page??
 *  [nookster](https://wordpress.org/support/users/nookster/)
 * (@nookster)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283567)
 * You need to set the php parser to be able to parse .html extensions. You do this
   by setting an Apache (or other server) handler to parse .html extensions with
   x-httpd-php
 * For CPanelX:
    In the main admin area, go to “Apache Handlers”. Then to add it,
   under “Extensions” type: .html …then under “Handler” type: x-httpd-php …then 
   click Add of course and viola. All your html extension files will now be parsed
   by the php processor if there’s any php code in them. I’m pretty sure this is
   what you’re looking for. Hope it helps.
 *  Thread Starter [Christiaan](https://wordpress.org/support/users/christiaan/)
 * (@christiaan)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283577)
 * Thanks Nookster, do I still need to do this even if I’m using index.php as opposed
   to index.html
 *  [goblue](https://wordpress.org/support/users/goblue/)
 * (@goblue)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283578)
 * Is there any CODE on the root level index page? I mean, there has to be something
   there. Try putting something simple there for testing. ie (`<h1>hello world</
   h1>`). If that little PHP block you had on your page was all that was there, 
   of course nothing will show!
 *  Thread Starter [Christiaan](https://wordpress.org/support/users/christiaan/)
 * (@christiaan)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283585)
 * Yes `<h1>hello world</h1>` works.
 * This is indeed the only code I had on the page. I thought that was all I needed:
 * `<?php
    require_once("blog/wp-blog-header.php"); define('WP_USE_THEMES', false);?
   >
 *  [jimisola](https://wordpress.org/support/users/jimisola/)
 * (@jimisola)
 * [19 years, 6 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283629)
 * I guess this issue is solved by now, but in case others find there way here I
   would like to point out that I believe that the reason why Christian had an empty
   page was because his require_once and define was in the wrong order. The default
   index.php for WP looks like this:
 * <?php
    /* Short and sweet */ define(‘WP_USE_THEMES’, true); require(‘./wp-blog-
   header.php’); ?>
 * so in his case the following probably would have worked
 * <?php
    /* Short and sweet */ define(‘WP_USE_THEMES’, true); require(‘blo/wp-blog-
   header.php’); ?>
 * a simple one would look like this:
 * <?php
    define(‘WP_USE_THEMES’, false); require_once(‘blog/wp-blog-header.php’);
 * get_header(); ?>
 *  <div id=”page”>
    <div id=”content”> Welcome to xyz.com </div>
 *  <?php get_sidebar(); ?>
 *  </div>
 *  <?php get_footer(); ?>
 * ?>

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

The topic ‘Calling php onto a static page’ is closed to new replies.

## Tags

 * [Blank](https://wordpress.org/support/topic-tag/blank/)
 * [front](https://wordpress.org/support/topic-tag/front/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [splash](https://wordpress.org/support/topic-tag/splash/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 6 participants
 * Last reply from: [jimisola](https://wordpress.org/support/users/jimisola/)
 * Last activity: [19 years, 6 months ago](https://wordpress.org/support/topic/calling-php-onto-a-static-page/#post-283629)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
