Hallo,
some hosting services may disable file inclusion over HTTP. The right steps are:
- use
require_once
to link your WP installation
- use an absolute or relative filesystem path to
wp-blog-header.php
- use the IIP’s
allowStatus
option if the page to include is not a published page (eg. draft or private)
Below you can find a tested example of code:
<?php
session_cache_limiter('none');
session_save_path("/Some/path/to/PHPSessions");
session_start();
require_once '/path/to/wordpress/wp-blog-header.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Test for WP IIP</title>
</head>
<body>
<h1>Hello World!</h1>
<?php if (function_exists('iinclude_page')) iinclude_page('/somepage', 'allowStatus=private,publish') ?>
<small>page ends here.</small>
</body>
</html>
Hope that helps
—
Vito