質問するログイン新規登録

回答編集履歴

2

ソースコード誤記訂正

2016/12/20 06:04

投稿

退会済みユーザー
answer CHANGED
@@ -11,7 +11,7 @@
11
11
  ####追記
12
12
  ```PHP
13
13
  wp_register_style( 'woocommerce-smallscreen',
14
- get_bloginfo('template_directory').'/woocommrce/assets/css/woocommerce-smallscreen.css'
14
+ get_bloginfo('template_directory').'/woocommrce/assets/css/woocommerce-smallscreen.css',
15
15
  array('woocommerce-layout'),
16
16
  false,
17
17
  'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', $breakpoint = '768px' ) . ')' );

1

コード例追記

2016/12/20 06:04

投稿

退会済みユーザー
answer CHANGED
@@ -6,4 +6,20 @@
6
6
  'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', $breakpoint = '768px' ) . ')'
7
7
  ),
8
8
  ```
9
- と書かれているので、`woocommerce-smallscreen.css`を`wp_register_style()`するときに、media値を指定しなければいけないのでは?
9
+ と書かれているので、`woocommerce-smallscreen.css`を`wp_register_style()`するときに、media値を指定しなければいけないのでは?
10
+
11
+ ####追記
12
+ ```PHP
13
+ wp_register_style( 'woocommerce-smallscreen',
14
+ get_bloginfo('template_directory').'/woocommrce/assets/css/woocommerce-smallscreen.css'
15
+ array('woocommerce-layout'),
16
+ false,
17
+ 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', $breakpoint = '768px' ) . ')' );
18
+ ```
19
+ 参考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)
20
+ > wp_register_style( $handle, $src, $deps, $ver, $media );
21
+
22
+ > $media
23
+ (文字列|真偽型) (オプション) このスタイルシートが定義されているメディアを指定する文字列。 例: 'all', 'screen', 'handheld', 'print'。
24
+ 参照:list for the full range of valid CSS-media-types.
25
+ 初期値: 'all'