简体   繁体   English

将Javascript包含到Wordpress 3.8中

[英]including Javascript into Wordpress 3.8

i'd like to include the virtual keyboard into my wordpress site but it doesn't function. 我想将虚拟键盘包含到我的wordpress网站中,但是它不起作用。

I use this howto include: http://archive09.linux.com/feature/134811 and i use this keyboard: http://freecode.com/projects/jsvk 我使用此方法包括: http : //archive09.linux.com/feature/134811,而我使用此键盘: http : //freecode.com/projects/jsvk

of course i also add some plugins in wordpress and search google, but i'm not a devleoper :) 当然,我也在wordpress中添加了一些插件并搜索google,但我不是devleoper :)

Can you give me some tipps? 你能给我一些小费吗?

thanks in advance. 提前致谢。

upload the file into your themes js folder or make one...... 将文件上传到您的主题js文件夹中,或创建一个……

in your themes functions php file 在您的主题功能的PHP文件

$url= get_stylesheet_directory_uri().'js/filename.js'; //input whatever path to file actually is.
function add_keyboard() {
wp_enqueue_script( 'keyboard', $url);
}
add_action( 'wp_enqueue_scripts', 'add_keyboard' );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM