回答編集履歴
2
ソースコード誤記訂正
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
wp_register_style( 'woocommerce-smallscreen',
|
26
26
|
|
27
|
-
get_bloginfo('template_directory').'/woocommrce/assets/css/woocommerce-smallscreen.css'
|
27
|
+
get_bloginfo('template_directory').'/woocommrce/assets/css/woocommerce-smallscreen.css',
|
28
28
|
|
29
29
|
array('woocommerce-layout'),
|
30
30
|
|
1
コード例追記
test
CHANGED
@@ -15,3 +15,35 @@
|
|
15
15
|
```
|
16
16
|
|
17
17
|
と書かれているので、`woocommerce-smallscreen.css`を`wp_register_style()`するときに、media値を指定しなければいけないのでは?
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
####追記
|
22
|
+
|
23
|
+
```PHP
|
24
|
+
|
25
|
+
wp_register_style( 'woocommerce-smallscreen',
|
26
|
+
|
27
|
+
get_bloginfo('template_directory').'/woocommrce/assets/css/woocommerce-smallscreen.css'
|
28
|
+
|
29
|
+
array('woocommerce-layout'),
|
30
|
+
|
31
|
+
false,
|
32
|
+
|
33
|
+
'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', $breakpoint = '768px' ) . ')' );
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
参考URL:[関数リファレンス/wp register style - WordPress Codex 日本語版](http://wpdocs.osdn.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/wp_register_style)
|
38
|
+
|
39
|
+
> wp_register_style( $handle, $src, $deps, $ver, $media );
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
> $media
|
44
|
+
|
45
|
+
(文字列|真偽型) (オプション) このスタイルシートが定義されているメディアを指定する文字列。 例: 'all', 'screen', 'handheld', 'print'。
|
46
|
+
|
47
|
+
参照:list for the full range of valid CSS-media-types.
|
48
|
+
|
49
|
+
初期値: 'all'
|