質問編集履歴

3

必要なphpの追加

2019/05/16 03:03

投稿

Samson818
Samson818

スコア162

test CHANGED
File without changes
test CHANGED
@@ -96,6 +96,28 @@
96
96
 
97
97
  ```
98
98
 
99
+ jsとcssでダッシュボード内にカスタムブロックを生成するためfunction.phpに追加する記述
100
+
101
+ ```php
102
+
103
+ /*------------
104
+
105
+ Gutenbergに対応したエディター独自タイル追加
106
+
107
+ ------------*/
108
+
109
+ function add_my_assets_to_block_editor() {
110
+
111
+ wp_enqueue_style( 'block-style', get_stylesheet_directory_uri() . '/gutenberg/block_style.css' );
112
+
113
+ wp_enqueue_script( 'block-custom', get_stylesheet_directory_uri() . '/gutenberg/block_custom.js',array(), "", true);
114
+
115
+ }
116
+
117
+ add_action( 'enqueue_block_editor_assets', 'add_my_assets_to_block_editor' );
118
+
119
+ ```
120
+
99
121
 
100
122
 
101
123
  ひとまず追加したカスタムブロックを指定するとHTMLが以下のように変更されるのは出来ました。

2

足りなかったcssを追加

2019/05/16 03:03

投稿

Samson818
Samson818

スコア162

test CHANGED
File without changes
test CHANGED
@@ -45,6 +45,20 @@
45
45
  padding-right: 0;
46
46
 
47
47
  background: url(../images/qa/icon_woman.gif) no-repeat top left;
48
+
49
+ }
50
+
51
+ p span{
52
+
53
+ display:block;
54
+
55
+ position:relative;
56
+
57
+ padding:24px 18px;
58
+
59
+ border:1px solid #999999;
60
+
61
+ border-radius:18px;
48
62
 
49
63
  }
50
64
 

1

間違えた画像を指定していた

2019/05/16 02:31

投稿

Samson818
Samson818

スコア162

test CHANGED
File without changes
test CHANGED
@@ -44,7 +44,7 @@
44
44
 
45
45
  padding-right: 0;
46
46
 
47
- background: url(../images/qa/icon_suspect.gif) no-repeat top left;
47
+ background: url(../images/qa/icon_woman.gif) no-repeat top left;
48
48
 
49
49
  }
50
50