質問編集履歴

1

文字列内の\$argsが変数として認識される問題を\(たぶん\)解決したコード

2016/01/14 02:29

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -163,3 +163,125 @@
163
163
  どこに間違いがあるのでしょうか?
164
164
 
165
165
  ご指摘のほどよろしくお願いします。
166
+
167
+
168
+
169
+ 追記:編集後のコードを記載
170
+
171
+
172
+
173
+ ```php
174
+
175
+ <?php
176
+
177
+ // 格納変数
178
+
179
+ $functions_php = null;
180
+
181
+
182
+
183
+ $functions_php = "
184
+
185
+
186
+
187
+ /********** ウィジェットエリア ***************/
188
+
189
+ // サイドバーのウィジェット
190
+
191
+ register_sidebar( array(
192
+
193
+ 'name' => __( 'Side Widget' ),
194
+
195
+ 'id' => 'side-widget',
196
+
197
+ 'before_widget' => '<li class="; $functions_php .= 'widget-container"'; $functions_php .= ">',
198
+
199
+ 'after_widget' => '</li>',
200
+
201
+ 'before_title' => '<h3>',
202
+
203
+ 'after_title' => '</h3>',
204
+
205
+ ) );
206
+
207
+
208
+
209
+ // フッターエリアのウィジェット
210
+
211
+ register_sidebar( array(
212
+
213
+ 'name' => __( 'Footer Widget' ),
214
+
215
+ 'id' => 'footer-widget',
216
+
217
+ 'before_widget' => '<div class="; $functions_php .= 'widget-area"'; $functions_php .= "><ul><li class="; $functions_php .= 'widget-container"'; $functions_php .= ">',
218
+
219
+ 'after_widget' => '</li></ul></div>',
220
+
221
+ 'before_title' => '<h3>',
222
+
223
+ 'after_title' => '</h3>',
224
+
225
+ ) );
226
+
227
+
228
+
229
+ /**************************************/
230
+
231
+
232
+
233
+ // アイキャッチ画像
234
+
235
+ add_theme_support( 'post-thumbnails' );
236
+
237
+ set_post_thumbnail_size(220, 165, true ); // 幅 220px、高さ 165px、切り抜きモード
238
+
239
+
240
+
241
+ // カスタムナビゲーションメニュー
242
+
243
+ add_theme_support('menus');
244
+
245
+
246
+
247
+ ";
248
+
249
+
250
+
251
+ if(isset($layout['main_visual'])){
252
+
253
+
254
+
255
+ $functions_php .= "
256
+
257
+ // ヘッダー画像
258
+
259
+ $"; $functions_php .= "args = array(
260
+
261
+ 'width' => 1100,
262
+
263
+ 'height' => auto,
264
+
265
+ 'header-text' => true,
266
+
267
+ 'default-image' => get_template_directory_uri() . '/images/";
268
+
269
+ $functions_php .= $layout["main_visual"]; $functions_php .= "',
270
+
271
+ 'uploads' => true,
272
+
273
+ );
274
+
275
+ add_theme_support( 'custoom-header',$"; $functions_php .= "args );
276
+
277
+ ";
278
+
279
+
280
+
281
+ } // 39行目のifの閉じ
282
+
283
+
284
+
285
+ ?>
286
+
287
+ ```