質問編集履歴
3
バージョン情報などの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -43,3 +43,43 @@
|
|
43
43
|
###詳細
|
44
44
|
|
45
45
|
[こちらのサイトのコードを利用しました。](http://kachibito.net/wordpress/admin-area-customize.html)
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
サーバーの情報
|
50
|
+
|
51
|
+
PHP情報
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
項目 内容
|
56
|
+
|
57
|
+
バージョン PHP 5.4.45
|
58
|
+
|
59
|
+
PEARモジュール
|
60
|
+
|
61
|
+
INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET:
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
その他の情報
|
66
|
+
|
67
|
+
項目 内容
|
68
|
+
|
69
|
+
Apacheバージョン Apache/2.4.20
|
70
|
+
|
71
|
+
MySQLバージョン 5.6.22 (Ver 14.14 Distrib 5.6.22)
|
72
|
+
|
73
|
+
PostgreSQLバージョン 9.3.5
|
74
|
+
|
75
|
+
SQLiteバージョン 2.8.17
|
76
|
+
|
77
|
+
3.6.20
|
78
|
+
|
79
|
+
OpenSSLバージョン 1.0.1e-fips
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
PHPなどのバージョンの問題の可能性はあるのでしょうか?
|
84
|
+
|
85
|
+
その辺は詳しくないので・・・
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
```
|
14
14
|
|
15
|
-
Parse error: syntax error, unexpected 'function' (T_FUNCTION) in /home/
|
15
|
+
Parse error: syntax error, unexpected 'function' (T_FUNCTION) in /home/中略/functions.php on line 96
|
16
16
|
|
17
17
|
```
|
18
18
|
|
@@ -43,195 +43,3 @@
|
|
43
43
|
###詳細
|
44
44
|
|
45
45
|
[こちらのサイトのコードを利用しました。](http://kachibito.net/wordpress/admin-area-customize.html)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
全てのコード
|
50
|
-
|
51
|
-
```php
|
52
|
-
|
53
|
-
<?php
|
54
|
-
|
55
|
-
// カスタム背景
|
56
|
-
|
57
|
-
$custom_background_defaults = array(
|
58
|
-
|
59
|
-
'default-color' => 'eef5ee',
|
60
|
-
|
61
|
-
'default-image' => get_bloginfo('template_url') . '/img/wall-pic.png',
|
62
|
-
|
63
|
-
);
|
64
|
-
|
65
|
-
add_theme_support( 'custom-background', $custom_background_defaults );
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
// ウィジェットエリア
|
70
|
-
|
71
|
-
// サイドバーのウィジェット
|
72
|
-
|
73
|
-
register_sidebar( array(
|
74
|
-
|
75
|
-
'name' => __( 'Side Widget light' ),
|
76
|
-
|
77
|
-
'id' => 'side-widget',
|
78
|
-
|
79
|
-
'before_widget' => '<li class="widget-container">',
|
80
|
-
|
81
|
-
'after_widget' => '</li>',
|
82
|
-
|
83
|
-
'before_title' => '<h3>',
|
84
|
-
|
85
|
-
'after_title' => '</h3>',
|
86
|
-
|
87
|
-
) );
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
register_sidebar( array(
|
92
|
-
|
93
|
-
'name' => __( 'Side Widget left' ),
|
94
|
-
|
95
|
-
'id' => 'side-widget2' ,
|
96
|
-
|
97
|
-
'before_widget' => '<li class="widget-container">',
|
98
|
-
|
99
|
-
'after_widget' => '</li>',
|
100
|
-
|
101
|
-
'before_title' => '<h3>',
|
102
|
-
|
103
|
-
'after_title' => '</h3>',
|
104
|
-
|
105
|
-
) );
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
// フッターエリアのウィジェット
|
110
|
-
|
111
|
-
register_sidebar( array(
|
112
|
-
|
113
|
-
'name' => __( 'Footer Widget' ),
|
114
|
-
|
115
|
-
'id' => 'footer-widget',
|
116
|
-
|
117
|
-
'before_widget' => '<div class="widget-area"><ul><li class="widget-container">',
|
118
|
-
|
119
|
-
'after_widget' => '</li></ul></div>',
|
120
|
-
|
121
|
-
'before_title' => '<h3>',
|
122
|
-
|
123
|
-
'after_title' => '</h3>',
|
124
|
-
|
125
|
-
) );
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
// カスタムナビゲーションメニュー
|
130
|
-
|
131
|
-
add_theme_support('menus');
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
// カスタムヘッダー
|
138
|
-
|
139
|
-
$custom_header_defaults = array(
|
140
|
-
|
141
|
-
'default-image' => get_bloginfo('template_url').'/images/bg_header.jpg',
|
142
|
-
|
143
|
-
'width' => 980,
|
144
|
-
|
145
|
-
'height' => 180,
|
146
|
-
|
147
|
-
'header-text' => false, //ヘッダー画像上にテキストをかぶせる
|
148
|
-
|
149
|
-
);
|
150
|
-
|
151
|
-
add_theme_support('custom-header', $custom_header_defaults );
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
add_filter( 'gettext', 'change_side_text' );
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
add_filter( 'ngettext', 'change_side_text' );
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
function change_side_text( $translated ) {
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
$translated = str_ireplace( 'ダッシュボード', '管理画面TOP', $translated );
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
$translated = str_ireplace( '投稿', 'ブログを書く', $translated );
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
$translated = str_ireplace( 'リンク', 'お気に入り', $translated );
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
$translated = str_ireplace( 'メディア', '画像の管理', $translated );
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
$translated = str_ireplace( '固定ページ', 'ページ追加', $translated );
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
$translated = str_ireplace( '外観', 'デザイン管理', $translated );
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
$translated = str_ireplace( 'ユーザー', 'プロフィール設定', $translated );
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
$translated = str_ireplace( '設定', '各種設定', $translated );
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
return $translated;
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
}
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
/* $translated = str_ireplace( '元々のテキスト', '置き換えるテキスト', $translated ); */
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
//ログアウトボタンを追加
|
212
|
-
|
213
|
-
function logout_button() {
|
214
|
-
|
215
|
-
global $wp_admin_bar;
|
216
|
-
|
217
|
-
$wp_admin_bar->add_menu(array(
|
218
|
-
|
219
|
-
'id' => 'logout_button',
|
220
|
-
|
221
|
-
'title' => __('ログアウトする'),
|
222
|
-
|
223
|
-
'href' => wp_logout_url()
|
224
|
-
|
225
|
-
));
|
226
|
-
|
227
|
-
}
|
228
|
-
|
229
|
-
add_action('wp_before_admin_bar_render', 'logout_button');
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
ここに該当コードを入力するとエラーが出ます。一番最初に持っていってもダメでした。
|
234
|
-
|
235
|
-
?>
|
236
|
-
|
237
|
-
```
|
1
コードを提示しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -43,3 +43,195 @@
|
|
43
43
|
###詳細
|
44
44
|
|
45
45
|
[こちらのサイトのコードを利用しました。](http://kachibito.net/wordpress/admin-area-customize.html)
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
全てのコード
|
50
|
+
|
51
|
+
```php
|
52
|
+
|
53
|
+
<?php
|
54
|
+
|
55
|
+
// カスタム背景
|
56
|
+
|
57
|
+
$custom_background_defaults = array(
|
58
|
+
|
59
|
+
'default-color' => 'eef5ee',
|
60
|
+
|
61
|
+
'default-image' => get_bloginfo('template_url') . '/img/wall-pic.png',
|
62
|
+
|
63
|
+
);
|
64
|
+
|
65
|
+
add_theme_support( 'custom-background', $custom_background_defaults );
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
// ウィジェットエリア
|
70
|
+
|
71
|
+
// サイドバーのウィジェット
|
72
|
+
|
73
|
+
register_sidebar( array(
|
74
|
+
|
75
|
+
'name' => __( 'Side Widget light' ),
|
76
|
+
|
77
|
+
'id' => 'side-widget',
|
78
|
+
|
79
|
+
'before_widget' => '<li class="widget-container">',
|
80
|
+
|
81
|
+
'after_widget' => '</li>',
|
82
|
+
|
83
|
+
'before_title' => '<h3>',
|
84
|
+
|
85
|
+
'after_title' => '</h3>',
|
86
|
+
|
87
|
+
) );
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
register_sidebar( array(
|
92
|
+
|
93
|
+
'name' => __( 'Side Widget left' ),
|
94
|
+
|
95
|
+
'id' => 'side-widget2' ,
|
96
|
+
|
97
|
+
'before_widget' => '<li class="widget-container">',
|
98
|
+
|
99
|
+
'after_widget' => '</li>',
|
100
|
+
|
101
|
+
'before_title' => '<h3>',
|
102
|
+
|
103
|
+
'after_title' => '</h3>',
|
104
|
+
|
105
|
+
) );
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
// フッターエリアのウィジェット
|
110
|
+
|
111
|
+
register_sidebar( array(
|
112
|
+
|
113
|
+
'name' => __( 'Footer Widget' ),
|
114
|
+
|
115
|
+
'id' => 'footer-widget',
|
116
|
+
|
117
|
+
'before_widget' => '<div class="widget-area"><ul><li class="widget-container">',
|
118
|
+
|
119
|
+
'after_widget' => '</li></ul></div>',
|
120
|
+
|
121
|
+
'before_title' => '<h3>',
|
122
|
+
|
123
|
+
'after_title' => '</h3>',
|
124
|
+
|
125
|
+
) );
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
// カスタムナビゲーションメニュー
|
130
|
+
|
131
|
+
add_theme_support('menus');
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
// カスタムヘッダー
|
138
|
+
|
139
|
+
$custom_header_defaults = array(
|
140
|
+
|
141
|
+
'default-image' => get_bloginfo('template_url').'/images/bg_header.jpg',
|
142
|
+
|
143
|
+
'width' => 980,
|
144
|
+
|
145
|
+
'height' => 180,
|
146
|
+
|
147
|
+
'header-text' => false, //ヘッダー画像上にテキストをかぶせる
|
148
|
+
|
149
|
+
);
|
150
|
+
|
151
|
+
add_theme_support('custom-header', $custom_header_defaults );
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
add_filter( 'gettext', 'change_side_text' );
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
add_filter( 'ngettext', 'change_side_text' );
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
function change_side_text( $translated ) {
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
$translated = str_ireplace( 'ダッシュボード', '管理画面TOP', $translated );
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
$translated = str_ireplace( '投稿', 'ブログを書く', $translated );
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
$translated = str_ireplace( 'リンク', 'お気に入り', $translated );
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
$translated = str_ireplace( 'メディア', '画像の管理', $translated );
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
$translated = str_ireplace( '固定ページ', 'ページ追加', $translated );
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
$translated = str_ireplace( '外観', 'デザイン管理', $translated );
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
$translated = str_ireplace( 'ユーザー', 'プロフィール設定', $translated );
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
$translated = str_ireplace( '設定', '各種設定', $translated );
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
return $translated;
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
}
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
/* $translated = str_ireplace( '元々のテキスト', '置き換えるテキスト', $translated ); */
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
//ログアウトボタンを追加
|
212
|
+
|
213
|
+
function logout_button() {
|
214
|
+
|
215
|
+
global $wp_admin_bar;
|
216
|
+
|
217
|
+
$wp_admin_bar->add_menu(array(
|
218
|
+
|
219
|
+
'id' => 'logout_button',
|
220
|
+
|
221
|
+
'title' => __('ログアウトする'),
|
222
|
+
|
223
|
+
'href' => wp_logout_url()
|
224
|
+
|
225
|
+
));
|
226
|
+
|
227
|
+
}
|
228
|
+
|
229
|
+
add_action('wp_before_admin_bar_render', 'logout_button');
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
ここに該当コードを入力するとエラーが出ます。一番最初に持っていってもダメでした。
|
234
|
+
|
235
|
+
?>
|
236
|
+
|
237
|
+
```
|