I have a pretty simple question. I want to make a static about page for my wordpress site. I don’t like the format of the wordpress static pages that are managed through the control panel so I thought I would make my one custom page where I would have full control of the layout, formatting & content. I have experience doing web development, so I thought I would edit the header.php
file of my tweaked theme to induce a statically typed menu link to about.php
in the wordpress root directory. When I tried to import the contents of header.php
in the about.php
file I got a 500 level internal server error. I am confused as to why I got this error. Was the error caused by my page being poorly constructed or because my hosting service has some configuration issue. I am not new to PHP or web-development but I am new to wordpress. What caused this error?
Error page:
0
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, cgiadmin@yourhostingaccount.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
about.php
<?php get_header(); ?>
<div id="primary">
<div id="content" role="main">
<p>Hello World!</p>
</div><!-- #content -->
</div><!-- #primary -->
<?php /* get_footer(); */ ?>
But that’s how the WordPress CMS is designed to be used. For static pages, create static pages.
WordPress provides a way to do that. If you want to create a custom page template for your About page, then create a proper custom page template from within WordPress, then assign it to a static page.
Including static pages from within WordPress is not a matter of linking to
filename.php
. In fact, that explicitly won’t work.Create a custom page template instead.
For example, quick and dirty:
More than likely, the error was caused by calling a WordPress function (
get_header()
) from outside of the running WordPress process.WordPress template files are not intended to be accessed directly; rather, they are included by the WordPress process, based on context, according to the template loader routine.