The term “Standalone” here refers to a page that run using WordPress engine but does not display using your WordPress theme. It means that your page can access all PHP functions in WordPress but you get to decide how the page looks like. The good news is, to do this using WordPress is amazingly easy.
Loading WordPress Engine
First thing to do is to load the WordPress core engine file, wp-load.php. Depends on where you want to put your custom page, you just need to use require_once(‘wp-load.php’), of course point it to correct folder if your custom page is in different folder.
In this example, i put my custom page in my WordPress root folder. Enter this in your custom page:
<?php
require_once('wp-load.php');
//if you put in "your-wordpress-root/wp-content/" folder , prepend with "../"
//to go "1 folder up"
//require_once('../wp-load.php');
?>
Congratulations, you just created a standalone WordPress custom PHP page. Isn’t that easy? Making the page Admin-Only
Very often you need limit access to your page to your blog admins only. You can check if the user is an admin after the require_once() statement:
As we said previously, after we loaded wp-load.php, we then have access to all WordPress functions, that is why we can use is_user_logged_in() and current_user_can() to check the user.
“manage_options” is the capability we used to check if the user is admin because all admins can “manage_options”. For more capabilities other than just “manage_options”, please refer to the WordPress Codex on Roles & Capabilities.