LoginSignup
6

More than 5 years have passed since last update.

【WordPress】functions.phpの罠

Posted at

(テストも兼ねて)

wordPress管理画面のメディアライブラリから画像をトリミング、拡大縮小をすることができるが、編集画面で画像が表示されない症状に陥った。
プラグインを全部オフにしても同じ症状が起こるので、プラグインが悪さをしている感じでもない。
しばらく悩んでいると、たまたま下記の様な記事を発見。

OK, it seems other guys had the same issue like you.
check your functions.php file, and any files included within.
if there are any errors or even empty lines strange things and errors will occur in wp-admin (WordPress Dashboard)
The problem may be an empty line between PHP tags

<?php function(){ ... } ?>

<?php function(){ ... } ?>

needs to be :

<?php function(){ ... } ?>
<?php function(){ ... } ?>

こんな仕様は想定外!
functions.phpで<?php ?>を使い時は注意。。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6