如何将我的JavaScript放在页脚中 [英] How to put my javascript in the footer

查看:262
本文介绍了如何将我的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆