• Hello,

    I’ve upgraded to WP 1.5 recently and decided to try and create a theme. I don’t know much about CSS and know even less PHP, but I’ve been getting ideas from tutorials and other people’s themes, especially the Kubrick theme.

    Today I was changing something in index.php. A simple thing, really. All I did was move the “get sidebar” PHP code from the top to the bottom. For some reason it messed up my whole blog- not the the theme that I was working on.

    Now I get this error message when I try to access my blog:

    Fatal error: Call to undefined function: get_header() in /home/fblogs/public_html/kaonashi/index.php on line 1

    I can still log in, write, etc. but I can’t view the blog itself. I didn’t touch index.php under the Kubrick theme. Why am I getting this error message?

    I searched the support forums to see if anyone else had this problem before, but I had no such luck. Please help. Thanks very much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You edited index.php in the root of your blog? That normally just has this:

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    ?>

    In any case, you need to have the call to wp-blog-header.php, otherwise get_header() won’t mean anything at all….

    Thread Starter kaonashi

    (@kaonashi)

    To be more specific, I edited this:

    <?php get_header(); ?>

    (“get sidebar” code was here)

    <div id=”wrapper”>
    <div id=”content” class=”narrowcolumn”>

    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h2>
    <small><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></small>

    <div class=”entry”>
    <?php the_content(‘Read the rest of this entry »’); ?>
    </div>

    <p class=”postmetadata”>Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’,”,’|‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>
    </div>

    <?php endwhile; ?>

    <div class=”navigation”>
    <div class=”alignleft”><?php next_posts_link(‘« Previous Entries’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘Next Entries »’) ?></div>
    </div>

    <?php else : ?>

    <h2 class=”center”>Not Found</h2>
    <p class=”center”>Sorry, but you are looking for something that isn’t here.
    <?php include (TEMPLATEPATH . “/searchform.php”); ?>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?> (now it’s here)

    </div>

    <?php get_footer(); ?>

    I don’t understand your advice though. Can you please be more specific?

    Thread Starter kaonashi

    (@kaonashi)

    I decided to re-upload the WP files so everything looks ok again.

    Thanks!

    I am having this same problem, and I also reinstalled my theme, and it still doesn’t work. Does anyone know anything about this?

    bethdean: it’s not a good idea, in my opinion, to cross post (someone may spend time on this when its possibly answered in the other thread)…
    https://www.ads-software.com/support/topic/34844

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘header error: fatal function’ is closed to new replies.