Reputation: 1285
I'm trying to learn how to build my own WordPress themes. I've been through a few tutorials but I've hit a snag. I can't seem to figure out what I'm doing wrong. When I have my html for my footer in the same file as my "home.php" it works fine. When I try to separate it however and place the footer html in "footer.php" and use the "get_footer();" function, the footer does not appear at all, visibly or in the code... it's not there. I am wondering if there is something else I have neglected to do to get the footer to work? If not then what could be causing the footer not to show up when I split up the code into different theme parts/files?
Here is the code for home.php:
<?php
/*
Template Name: Front Page
*/
?>
<?php get_header(); ?>
<?php get_template_part('nav'); ?>
<div id="content"><!-- Start Content -->
<?php get_sidebar('left'); ?>
<div id="middle-column" class="grid_8"><!-- Main Content Begins Here -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?><!-- Start Loop -->
<div class="post">
<h2 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h2>
<div class="entrytext">
<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
</div>
</div>
<?php
endwhile;
else:
?>
<?php _e('This page does not appear to have been set up yet. Sorry, please try again later. Thanks!'); ?>
<?php endif; ?>
<!-- End Loop -->
</div>
<?php get_sidebar('right'); ?>
<?php get_footer(); ?>
and here is the code for footer.php:
<div style="clear:both;"></div>
<div id="push"></div>
</div><!-- End Content -->
</div><!-- End Container -->
</div><!-- End Wrapper -->
<div id="footer"><!-- Start Footer -->
<div id="footWrap"><!-- Start #footWrap -->
<p>© Brent Blackwood</p>
</div><!-- End #footWrap -->
</div><!-- End Footer -->
<div id="headerBand"></div><!-- Placed here for SEO purposes -->
<div id="navBand"></div><!-- Placed here for SEO purposes -->
</body>
</html>
Upvotes: 0
Views: 16158
Reputation: 2850
I don't see anything obviously wrong.
Do you have define('WP_DEBUG',true);
in your wp-config.php? If not, add that and see if there are errors that might help.
Are you sure it fails at get_footer()
and not before, with get_sidebar()
for example?
Are your "Front Page" template file and footer.php in the same directory?
Do you have a public URL?
Upvotes: 7