Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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(); */ ?>
share|improve this question
    
You might want to see the actual error (as it appears the host is providing a generic error message for security purposes, which is standard). Do you have access to the error logs? If I speculate, it sounds like you're trying to include your WordPress specific header inside your own custom PHP file. header.php depends on the full WordPress framework to function properly. I think you'll have problems customizing this page outside of the WordPress framework. –  Jared Cobb Jan 18 '13 at 18:09
    
@JaredCobb Your speculation is correct. Do i need to include certain files from the theme for get_header() to work correctly? –  recursion.ninja Jan 18 '13 at 18:12
    
"static pages that are managed through the control panel" can look anyway you like. There really aren't any design or layout restrictions. Are you talking about a theme's control panel perhaps? –  s_ha_dum Jan 18 '13 at 19:59

1 Answer 1

up vote 2 down vote accepted

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...

But that's how the WordPress CMS is designed to be used. For static pages, create static pages.

so I thought I would make my one custom page where I would have full control of the layout, formatting & content.

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.

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.

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:

<?php
/** 
 * Template Name: About Page
 */

get_header();

// Your custom layout goes here

get_footer();

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?

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.

share|improve this answer
    
Thanks for the post about custom template pages. I have used this to correctly create the static pages I intended with full control of the the content and formatting. –  recursion.ninja Jan 18 '13 at 21:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.