treehouse : what would you like to learn today?
Web Design Web Development iOS Development

What does this mean?

  • I created a home.php file for a custom home page within my theme. Website works fine, but I checked my error log file and I am getting this message.

    PHP Fatal error: Call to undefined function get_header() in /home/test/public_html/wp-content/themes/empty-Theme/index.php

    Thanks for any help or suggestions?
  • I have found a post here but it does not offer a reason on why it is happening. Any help would be great.
  • Post the code from the index.php file so we can try to help you.
  • Here is the code.Thanks for taking the time to look at it.

    <?php get_header(); ?>

    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">

    <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>

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


    <div class="content">
    <?php the_content(); ?>
    </div>



    </div>

    <?php endwhile; ?>

    <?php else : ?>

    <h2>Not Found</h2>

    <?php endif; ?>


    <?php get_footer(); ?>
  • doesn't if have posts have to come after get_header?
  • Yes, that is actually where I originally had it, but I moved it around to see if it would make a difference in the error log and it did not. After reading and reading yesterday, it appears to have something to do with certain themes, but I have not been able to find the problem.
  • what version of wordPress are you using, and which template is this on?
  • Using 3.2 and it is on a blank template... got it from here
  • that would be 3.2.1, the latest version.
  • Use the HTML5 Reset Theme that is based on the Blank Theme by DigWp.