开发者

Add custom js to add functionality to themes options-page on Wordpress admin-panel?

开发者 https://www.devze.com 2023-02-01 04:25 出处:网络
I 开发者_如何学Chave a theme, which has a options-page. I need to create tabs for it, so I need to include my custom js-file.

I 开发者_如何学Chave a theme, which has a options-page. I need to create tabs for it, so I need to include my custom js-file.

I've tried this:

function add_js() {
    echo '<script type="text/javascript" src="'.get_bloginfo('template_url').'/options/js.js'.'"></script>';
}

add_action('wp_head','add_js');

However, this obiviously adds the script to the blog itself, but not the admin-panel. How to include this js-file only in options-page?

Thanks, Martti Laine


Might i refer you to to the following WPSE topic.
https://wordpress.stackexchange.com/questions/2073/including-css-and-js-on-admin-screen-of-custom-theme-options

Hope that helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消