回答編集履歴

1

コードサンプル追記

2015/09/18 09:58

投稿

KazuhiroHatano
KazuhiroHatano

スコア7804

test CHANGED
@@ -17,3 +17,37 @@
17
17
  theme_mods_{子テーマ名}に入れる
18
18
 
19
19
  というような処理をすればいいかと思います
20
+
21
+
22
+
23
+ ---
24
+
25
+
26
+
27
+ コードサンプル追記
28
+
29
+
30
+
31
+ 以下のコードをfunctions.phpに、テストしてません
32
+
33
+
34
+
35
+ ```php
36
+
37
+ <?php
38
+
39
+ add_action('after_switch_theme',function(){
40
+
41
+ $theme_name = wp_get_theme()->get('Name');
42
+
43
+ if($parent_theme_name = wp_get_theme()->get('Template')){
44
+
45
+ add_option("theme_mods_$theme_name",get_option("theme_mods_$parent_theme_name"));
46
+
47
+ }
48
+
49
+ });
50
+
51
+ ?>
52
+
53
+ ```