wp_footer()激活wp_footer动作

目录

描述

Fire the 'wp_footer' action. Put this template tag immediately before </body> tag in a theme template (ex. footer.php, index.php).

wp_footer() 描述

用法

 <?php wp_footer(); ?> 

wp_footer() 用法

参数

This function does not accept any parameters.

wp_footer() 参数

示例

In twentyten theme

wp-content/themes/twentyten/footer.php:

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
...
<?php
   /* Always have wp_footer() just before the closing </body>
    * tag of your theme, or you will break many plugins, which
    * generally use this hook to reference JavaScript files.
    */
    wp_footer();
?>
</body>
</html>

wp_footer() 示例

注意

wp_footer() 注意

历史

  • 添加于 版本: 1.5.1

wp_footer() 历史

源文件

wp_footer() 函数的代码位于 wp-includes/general-template.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * Fire the wp_footer action
 *
 * @since 1.5.1
 */
function wp_footer() {
	/**
	 * Print scripts or data before the closing body tag on the front end.
	 *
	 * @since 1.5.1
	 */
	do_action( 'wp_footer' );
}

wp_footer() 源文件

相关