WordPress.org

Ready to get started?Download WordPress

Forums

Footer not showing in correct position (6 posts)

  1. Lauren
    Member
    Posted 5 years 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(); ?>

  2. Lauren
    Member
    Posted 5 years 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?

  3. Lauren
    Member
    Posted 5 years ago #

    Anyone?

  4. Lauren
    Member
    Posted 5 years 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.

  5. Lauren
    Member
    Posted 5 years 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.

  6. Martian Art Slave
    Member
    Posted 5 years 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?)

Topic Closed

This topic has been closed to new replies.

About this Topic