wp_footer()WP 1.5.1

Fires the wp_footer action. This is one of the most important hooks, many plugins will not work without it. It needs to be called in the theme footer, in footer.php file.

This template tag should be placed right before the closing HTML tag </body>.

See wp_head() — a similar function that runs the wp_head hook in the theme header.

Hooks from the function

Return

null. Nothing (null).

Usage

<?php wp_footer(); ?>

Examples

0

#1 Required code in the footer of any theme

This example is taken from the default twentyten theme: wp-content/themes/twentyten/footer.php:

...
<?php
   /**
	* Always use wp_footer() before </body> close tag
	* otherwise, many plugins will not work correctly because
	* they use this hook to add their's JS and other codes.
	*/
	wp_footer();
?>
</body>
</html>

Changelog

Since 1.5.1 Introduced.

wp_footer() code WP 6.4.3

function wp_footer() {
	/**
	 * Prints scripts or data before the closing body tag on the front end.
	 *
	 * @since 1.5.1
	 */
	do_action( 'wp_footer' );
}