function.phpに記述する方法もあるようですが、header.phpに記述しています。
wordpressが持っているjQueryを使用して、サーバー内にあるslicknav.jsを動作させたいです。
slicknavのurlにミスはないようですが、jQueryのurlに欠点があるのかもしれません。
修正点を教えてください。
jsフォルダは作っていないです。作った方がいいでしょうか?
それと「ハンドル」というワードを検索しても理解できません。
この場合はどこがハンドルになりますか?
<header.php>
<!doctype html> <html <?php language_attributes(); ?>> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="format-detection" content="telephone=no, email=no, address=no"> <title><?php if( is_single() ): wp_title('|', true, 'right'); endif; bloginfo('name'); ?></title> <meta name="description" content=""> <meta name="keywords" content=""> <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/original.css"> <link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>"> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link rel="icon" href="<?php echo get_template_directory_uri(); ?>/images/favicon.ico"> <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="<?php echo get_template_directory_uri(); ?>/images/favicon.ico"> <link rel="apple-touch-icon" href="<?php echo get_template_directory_uri(); ?>/images/favicon.ico"> <meta name="apple-mobile-web-app-title" content="test"> <meta name="application-name" content="test"> <meta name="author" content=""> <?php wp_enqueue_script( 'slicknav', get_template_directory_uri() .'/jquery.slicknav.js', array( 'jquery') ); ?> <?php wp_head(); /* Template Name: WP1 */ ?> <script> jQuery(function () { jQuery(document).ready(function(){ jQuery('#menu').slicknav(); }); } </script> </head> <body <?php body_class(); ?>> <div class="header clearfix"> <h1 class="md-5 xs-10"> <a href="<?php echo home_url(); ?>/"><img src="<?php header_image(); ?>" alt="<?php bloginfo('name'); ?>"></a> </h1> <h2 class="md-5 xs-10"><?php bloginfo('description'); ?></h2> <div id="menu" class="clearfix"> <?php wp_nav_menu(); ?> </div> </div>
質問ばかりですみません。
追記
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/04/20 11:09
2016/04/20 12:00 編集
2016/04/20 16:29
2016/04/21 11:53