WordPress.org

Ready to get started?Download WordPress

Forums

Alternative wp_footer hook? (3 posts)

  1. SolarDarkness
    Member
    Posted 8 years ago #

    I'm writing a plugin to display some statistics at the bottom of a page, yet when I use the wp_footer hook, the text is shown outside of the site template. Is there a similar hook or filter I could use that would keep the text in the template?

  2. Ming
    Member
    Posted 8 years ago #

    Output to a hook is displayed at the same place that hook is displayed. As long as your wp_footer is called in the template then that's where your output will go.

    Maybe your wp_footer is out of place or maybe your plugin is adding extra html/css that's breaking your layout?

  3. SolarDarkness
    Member
    Posted 8 years ago #

    I was using a default template, the problem was that it was calling the callback at the end of the body tag rather than in my set of divs. I used a little javascript to fix this:

    document.getElementById('footer').innerHTML = document.getElementById('footer').innerHTML.concat([my output]);

    Probably not the best way to do it but it works on everything I've tested it on.

Topic Closed

This topic has been closed to new replies.

About this Topic