The MU forums have moved to WordPress.org

get header doesnt work (4 posts)

  1. jasontower
    Member
    Posted 15 years ago #

    I use a theme for my website.
    I want to load a php file which echos some mysql database value. But I want to keep the theme template. So I added the
    <?php get_header(); ?>
    my php code
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    in the php file, and put that file in the domain root folder.
    But when the page loads the php file, a blank page appears. I don't know what wrong it is.
    I also tried copy the theme's 404 file code into my php file, but it still doesnt work.
    I tried to load the 404 file direcity(I copy it under the root folder), it is still a blank page.
    The 404.php file of that theme is attached below. Thanks!
    <?php get_header(); global $wp_theme_options; ?>
    <!--404.php-->

    <div id="container" class="clearfix">

    <div id="content">
    <div class="entry">
    <h1 class="pagetitle"><?php _e("Page Not Found"); ?></h1>
    <p><?php _e("We're sorry, but the page you are looking for isn't here."); ?></p>
    <p><?php _e("Try searching for the page you are looking for or using the navigation in the header or sidebar") ?></p>
    </div>
    </div><!--end content div-->

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

  2. andrea_r
    Moderator
    Posted 15 years ago #

    "But when the page loads the php file, a blank page appears. I don't know what wrong it is."

    That means an error. Check your error logs for specifics, because it'll tell you.

    Also see this:
    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

  3. jasontower
    Member
    Posted 15 years ago #

    How can I check the error logs?

  4. dsader
    Member
    Posted 15 years ago #

    Don't add files to the domain root, add/customize files in your active template folder instead.

About this Topic

  • Started 15 years ago by jasontower
  • Latest reply from dsader