WordPress.org

Support

Support » Plugins and Hacks » Alternative wp_footer hook?

Alternative wp_footer hook?

  • SolarDarkness
    Member

    @solardarkness

    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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?

    SolarDarkness
    Member

    @solardarkness

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Alternative wp_footer hook?’ is closed to new replies.