Skip to content

Instantly share code, notes, and snippets.

@theodorocaliari
Forked from tylerhall/index.php
Created June 24, 2014 19:33
Show Gist options
  • Save theodorocaliari/a12f22f54c5ab0361db4 to your computer and use it in GitHub Desktop.
Save theodorocaliari/a12f22f54c5ab0361db4 to your computer and use it in GitHub Desktop.
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
$s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : '';
$port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (":".$_SERVER['SERVER_PORT']);
$url = "http$s://" . $_SERVER['HTTP_HOST'] . $port;
define('WP_HOME', $url);
define('WP_SITEURL', $url);
unset($s, $port, $url);
/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment