Title: WordPress PHP in hello.html
Last modified: August 20, 2016

---

# WordPress PHP in hello.html

 *  [a4jp](https://wordpress.org/support/users/a4jpcom/)
 * (@a4jpcom)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/wordpress-php-in-hellohtml/)
 * Do you know how to get something like the WordPress PHP code below working in
   a HTML file and not a file with a PHP extension? I know the PHP code works in
   a PHP file.
 *     ```
       <html>
       <head></head>
       <body>
       <?php
       require('http://agreatdream.com/wp-blog-header.php');
       ?>
   
       <?php
       	echo "You are here.";
   
         if (is_user_logged_in()){
       		echo "You are logged in.\n";
       	}
       	else {
       		echo "You are not logged in.\n";
       };
       ?>
       </body>
       </html>
       ```
   
 * Glen

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

 *  [Jarret](https://wordpress.org/support/users/jarretc/)
 * (@jarretc)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/wordpress-php-in-hellohtml/#post-2495231)
 * You have to save the file as .php and not .html.
 * Is there any particular reason you are wanting to use .html?
 *  [Pankaj Pandey](https://wordpress.org/support/users/pankajdey/)
 * (@pankajdey)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/wordpress-php-in-hellohtml/#post-2495282)
 * add below in your .htaccess
    `AddType application/x-httpd-php .html`
 * also i suggest you need to change your include your wp-blog-header to relative
   to file not with http
 *     ```
       <?php
       require('../path/wp-blog-header.php');
       ?>
       ```
   
 *  [Pankaj Pandey](https://wordpress.org/support/users/pankajdey/)
 * (@pankajdey)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/wordpress-php-in-hellohtml/#post-2495283)
 * [http://php.about.com/od/advancedphp/p/html_php.htm](http://php.about.com/od/advancedphp/p/html_php.htm)

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

The topic ‘WordPress PHP in hello.html’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Pankaj Pandey](https://wordpress.org/support/users/pankajdey/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/wordpress-php-in-hellohtml/#post-2495283)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
