Add php page to wordpress off topic

I added the php page ( test.php) to my root directory (WWW) where Wordpress is installed. I don't want to use the custom template method (add this page to my Wordpress theme directory) I added the following to this php file:

<?php
require('wp-blog-header.php');
get_header();
?>
<h1>Test</h1>
<?php
get_footer();
?>

When I do www.example.com/test.phpthis : this page loads correctly, but the title of this page displays " error 404"

I do not understand how to solve this problem.

+4
source share
2 answers

you need to enable wp-load.php to use the header, in your case replace require('wp-blog-header.php');with

<?php require_once('wp-load.php'); ?>
+4
source

test.php. , require ('wp-blog-header.php'); require_once ('wp-load.php');

+1

All Articles