一直在尝试让 javascript 库在 wordpress 中运行,但我不太确定要在 .ready(function) 中放入什么才能运行库。jQuery函数的原始页面在这里: http: //manos.malihu.gr/simple-jquery-fullscreen-image-gallery/2
我假设我需要运行一些将运行整个 javascript 文件的函数,但我不太确定该函数可能是什么。很抱歉对此如此陌生,但非常感谢您的帮助!
function malihu_gallery() {
if (!is_admin()) {
// Enqueue Malihu Gallery JavaScript
wp_register_script('malihu-jquery-image-gallery', get_template_directory_uri(). '/js/malihu-jquery-image-gallery.js', array('jquery'), 1.0, true );
wp_enqueue_script('malihu-jquery-image-gallery');
// Enqueue Malihu Gallery Stylesheet
wp_register_style( 'malihu-style', get_template_directory_uri() . '/CSS/malihu_gallery.css', 'all' );
wp_enqueue_style('malihu-style' );
function gallery_settings () { ?>
<script type="text/javascript">
jQuery(document).ready(function() {
// What do I put in here?
});
</script><?php
}
}
}
add_action('init', 'malihu_gallery');