• 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(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Each of these functions require that you php include the wp-blog-header.php file so it will load all those functions before they are executed. If the file is in the root of your wordpress install, you can simply add the following to the top of the file:

    require(‘./wp-blog-header.php’);

    You’re probably better off developing your own wordpress theme than creating your own pages though. Information about that can be found here:
    http://codex.wordpress.org/Theme_Development

    [signature moderated Please read the Forum Rules]

    Thread Starter jasontower

    (@jasontower)

    Thanks!
    the get_header work very well!
    but the get_sidebar and get_footer still dont work

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘get header doesnt work’ is closed to new replies.