WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Move WP Admin Bar Outside Footer Div (3 posts)

  1. inhouse
    Member
    Posted 1 year ago #

    Hi, I was wondering if it's at all possible to move the wpadminbar outside of the footer div on a custom theme. Short story is that I need my footer div to be beneath (z-index:1) the main-content area (z-index:2) while my header wrap is on top (z-index:3). Even though the admin bar is z-index:9999 it is still not on top because it is inside the footer div. My thinking was that if I can move the admin bar outside of the footer div it wouldn't be suppressed by the footer div. I can't seem to figure out how this can be done. Is this possible with a functions modification or does WP absolutely require it to be inside footer? I tried adding a new container around footer but the admin bar still ends up falling in the same spot. Without going in to details, my footer NEEDS to be beneath the main content area sor styling and functionality reasons.

    I haven't seen this asked in the forum so if anyone has any suggestions, I'd appreciate it! Thanks.

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    what theme are you using?
    what is the code in footer.php?

    the admin bar is probably hooked into wp_footer(); and that should be outside any divs; see example of Twenty Eleven:

    </footer><!-- #colophon -->
    </div><!-- #page -->
    
    <?php wp_footer(); ?>
    
    </body>
    </html>
  3. inhouse
    Member
    Posted 1 year ago #

    Oh yeah, that works! I didn't know that was what placed the admin bar. That never occurred to me. What a bone head problem that was. wp_footer was inside my footer div. Should have been more obvious to me.

    Thanks alchymyth!

Topic Closed

This topic has been closed to new replies.

About this Topic