liliripe
Member
Posted 5 months ago #
I am coding a new theme for my site, but for some reason, the footer keeps showing at the top of my page. Here's my footer.php code:
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
?>
<div id="footer">
Text text text.
</div>
<?php wp_footer(); ?>
</body>
</html>
And here's the footer code at the bottom of my index.php file:
<?php get_footer(); ?>
liliripe
Member
Posted 5 months ago #
I've tried various CSS and HTML codes to try to make the footer "stick" to the bottom of the page, as opposed to the bottom of my window (which is only halfway down the page once I scroll), but nothing works. I copied the code from the Default theme and it's still not showing up at the very bottom of the page... any ideas?
liliripe
Member
Posted 5 months ago #
liliripe
Member
Posted 5 months ago #
Update: I've found that when I make my content div float: left or float: right, the footer "sticks" to the bottom of the page. Yet when I make my content div position: absolute (which is what I need so I can position it), the footer creeps up. Is there any way around this?? Thanks.
liliripe
Member
Posted 5 months ago #
Solved. I kept the content and navigation divs as float:right and float:left, and used padding to position them instead of position: absolute. The footer now stays at the bottom of the page.
Martian Art Slave
Member
Posted 5 months ago #
Thanks for writing your progress up, liliripe.
I came looking for the answer and as soon as a saw the "float:" approach I knew that was it and had my problem fixed in minutes.
Cheers (and I hope you get this?)