如何将我的 javascript 放在页脚中 [英] How to put my javascript in the footer
本文介绍了如何将我的 javascript 放在页脚中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只想询问如何使用简单的插件在页脚处打印脚本javascript".我正在使用 WordPress 3.0 有什么想法吗?
I just want to ask on how to print script 'javascript' at the footer using simple plugin. I'm using WordPress 3.0 any ideas?
推荐答案
在主题模板中使用 functions.php 文件添加:
Use a functions.php file inside your theme template add this :
<?php
function add_this_script_footer(){ ?>
[YOUR JS CODE HERE]
<?php }
add_action('wp_footer', 'add_this_script_footer'); ?>
希望能帮到你!
这篇关于如何将我的 javascript 放在页脚中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文