The problem is that about.php
is not a recognized file by WordPress and won’t load any of the actual WordPress functions. <?php wp_header(); ?>
in your themes header.php
file actually loads most the WordPress functionality that you’re used to using. Since you’re not calling either get_header()
OR wp_header()
in your about.php
file you don’t actually have access to any of the WordPress functionality. One solution to this would be to include a core WordPress file at the top of your post which will give you this kind of access:
This file: require('/wp-blog-header.php');
The required file is located in the root of WordPress, same place as wp-config.php
– I believe this will load what you need.
Here’s a list of Recognized Template Files.
What should do though…
Is find a way to use the build in wp_ajax
functionality to get your page and bring it back. Then there’s no extra file, no need to require wp-blog-header.php
and it hook / function would be conveniently located in your themes functions.php
file