0
私はjquery one page scroll pluginでwordpressテンプレートをコーディングしようとしています。jQuery One Page WordPressテーマをスクロール
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/bootstrap/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/bootstrap/js/jquery.onepage-scroll.js"></script>
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/bootstrap/js/front.js"></script>
プラグインを:footer.phpするためにそれを含めた後
function wpbootstrap_scripts_with_jquery() {
// Register the script like this for a theme:
wp_register_script('bootstrap', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', array('jquery'));
wp_register_script('one-page', get_template_directory_uri() . '/bootstrap/js/jquery.onepage-scroll.js' , '', '', true);
wp_register_script('front', get_template_directory_uri() . '/bootstrap/js/jquery.onepage-scroll.js', array('jquery'));
// For either a plugin or a theme, you can then enqueue the script:
wp_enqueue_script('bootstrap');
wp_enqueue_script('one-page');
wp_enqueue_script('front');
}
add_action('wp_enqueue_scripts', 'wpbootstrap_scripts_with_jquery');
:誰かが私はこのようなのfunctions.phpファイルを使用して、私のテンプレートに追加したときにプラグインが動作しない理由を理解するために私を助けることができます働くしかし、私はむしろ、第1の方法を第2の方法よりも使いたい。誰も私がfunctions.phpで間違っていることを知っていますか?
あなたは彼らがこだまし、ソースに適切にリンクされ見ることができます前に、スクリプトの最後に追加し終わり
true
を追加しますか? –ページソース – user3085804
のすべてがフッターでも同じシーケンスですか?これらのファイルの前にjqueryがロードされていますか? –