Reputation: 29
I have added a php page (test.php
) in my root directory (WWW) where wordpress is installed. I don't want to use the custom template method (add this page in my wordpress theme directory)
I have added in this php file this:
<?php
require('wp-blog-header.php');
get_header();
?>
<h1>Test</h1>
<?php
get_footer();
?>
When I do: www.example.com/test.php
this page is correctly loading but the title of this page display "error 404
"
I don't understand how can I resolve this problem.
Upvotes: 3
Views: 1530
Reputation: 8819
you need to include wp-load.php to use header, in your case replace require('wp-blog-header.php');
with
<?php require_once('wp-load.php'); ?>
Upvotes: 3
Reputation: 825
I have placed this code in my root directory in test.php file. This code is working fine if you replace require('wp-blog-header.php'); with require_once('wp-load.php');
Upvotes: 1