forked from xserver-inc/cocoon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
scripts.php
188 lines (150 loc) · 6.31 KB
/
scripts.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php //CSSやJSファイルの呼び出し
add_action( 'wp_enqueue_scripts', 'wp_enqueue_scripts_custom', 1 );
if ( !function_exists( 'wp_enqueue_scripts_custom' ) ):
function wp_enqueue_scripts_custom() {
////////////////////////////////////////////////////////////////
//
//スタイルシートの呼び出し
//
////////////////////////////////////////////////////////////////
///////////////////////////////////////////
//テーマスタイルの呼び出し
///////////////////////////////////////////
wp_enqueue_style_theme_style();
///////////////////////////////////////////
//Font Awesome
///////////////////////////////////////////
wp_enqueue_style_font_awesome();
///////////////////////////////////////////
//設定変更に必要なCSS
///////////////////////////////////////////
wp_add_css_custome_to_inline_style();
///////////////////////////////////////////
//IcoMoon
///////////////////////////////////////////
wp_enqueue_style_icomoon();
///////////////////////////////////////////
//ソースコードのハイライト表示
///////////////////////////////////////////
wp_enqueue_highlight_js();
///////////////////////////////////
//画像リンク拡大効果がLightboxのとき
///////////////////////////////////
wp_enqueue_lightbox();
///////////////////////////////////
//画像リンク拡大効果がLityのとき
///////////////////////////////////
wp_enqueue_lity();
///////////////////////////////////
//画像リンク拡大効果がbaguetteboxのとき
///////////////////////////////////
wp_enqueue_baguettebox();
///////////////////////////////////
//サイドバー追従領域やグローバルナビの追従用
///////////////////////////////////
//wp_enqueue_clingify();
///////////////////////////////////
//サイドバー追従領域やグローバルナビの追従用
///////////////////////////////////
wp_enqueue_stickyfill();
///////////////////////////////////
//カルーセル用
///////////////////////////////////
wp_enqueue_slick();
///////////////////////////////////
//ツリー型モバイルボタン
///////////////////////////////////
wp_enqueue_slicknav();
///////////////////////////////////////////
//Google Fonts
///////////////////////////////////////////
wp_enqueue_google_fonts();
////////////////////////////////////////////////////////////////
//
//スキンスタイルの呼び出し
//
////////////////////////////////////////////////////////////////
///////////////////////////////////////////
//スキンスタイルの読み込み
///////////////////////////////////////////
wp_enqueue_style_theme_skin_style();
////////////////////////////////////////////////////////////////
//
//子テーマスタイルの呼び出し
//
////////////////////////////////////////////////////////////////
///////////////////////////////////////////
//子テーマのstyle.css
///////////////////////////////////////////
wp_enqueue_style_theme_child_style();
////////////////////////////////////////////////////////////////
//
//Wordpress関係スクリプトの呼び出し
//
////////////////////////////////////////////////////////////////
///////////////////////////////////////////
//jQueryの読み込み
///////////////////////////////////////////
//wp_enqueue_script('jquery');
//レンダリングをブロックしている jQuery, jQuery-migrate をフッタに移動する
if (!is_admin()) {
//jQueryライブラリの読み込み
wp_enqueue_script_jquery_js();
// wp_deregister_script('jquery');
// //wp_deregister_script('jquery-core');
// wp_deregister_script('jquery-migrate');
// wp_register_script('jquery', false, array('jquery-core', 'jquery-migrate'), '1.12.4', true);
// wp_enqueue_script('jquery');
// wp_enqueue_script('jquery-core', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', array(), '1.12.4', true);
// wp_enqueue_script('jquery-migrate', '//cdnjs.cloudflare.com/ajax/libs/jquery-migrate/1.4.1/jquery-migrate.min.js', array(), '1.4.1', true);
//タイルカード
wp_enqueue_jquery_masonry();
}
///////////////////////////////////////////
//コメント返信時のフォームの移動(WPライブラリから呼び出し)
///////////////////////////////////////////
if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
///////////////////////////////////////////
//テーマ内で使用するJavaScript関数をまとめて定義する外部ファイルを呼び出す(javascript.js)
///////////////////////////////////////////
wp_enqueue_script( THEME_JS, get_template_directory_uri() . '/javascript.js', array( 'jquery' ), false, true );
///////////////////////////////////
//はてブシェアボタン用のスクリプト呼び出し
///////////////////////////////////
if ( is_bottom_hatebu_share_button_visible() && is_singular() ){
wp_enqueue_script( 'st-hatena-js', '//b.st-hatena.com/js/bookmark_button.js', array(), false, true );
}
///////////////////////////////////
//Pinterest用のスクリプト呼び出し
///////////////////////////////////
//wp_enqueue_script( 'pinterest-js', '//assets.pinterest.com/js/pinit.js', array(), false, true );
////////////////////////////////////////////////////////////////
//
//スキンscriptの呼び出し
//
////////////////////////////////////////////////////////////////
if (is_child_theme()) {
///////////////////////////////////////////
//子テーマのjavascript.js
///////////////////////////////////////////
$js_url = get_skin_js_url();
$js_path = url_to_local($js_url);
//javascript.jsファイルがスキンフォルダに存在する場合
if ($js_url && file_exists($js_path)) {
//var_dump($js_path);
wp_enqueue_script( THEME_SKIN_JS, $js_url, array( 'jquery', THEME_JS ), false, true );
}
}
////////////////////////////////////////////////////////////////
//
//子テーマscriptの呼び出し
//
////////////////////////////////////////////////////////////////
if (is_child_theme()) {
///////////////////////////////////////////
//子テーマのjavascript.js
///////////////////////////////////////////
wp_enqueue_script( THEME_CHILD_JS, get_stylesheet_directory_uri() . '/javascript.js', array( 'jquery', THEME_JS ), false, true );
}
}
endif;