以前wordpressで作ったサイトを見ていたら、以下のようなエラーが文字で出ていて、
Warning: Use of undefined constant HISTROY – assumed ‘HISTROY’ (this will throw an Error in a future version of PHP) in /home/wordpress/wp-content/themes/wordpress/tpl-history.php on line 24
表示されるはずのサイドバーが表示されていなかった。
これも、phpのバージョンアップのせいだね。
tpl-history.phpファイルの24行目を
<?php get_sidebar(history); ?>
↓
<?php get_sidebar('history'); ?>
と修正したら、解決した。
https://wpdocs.osdn.jp/関数リファレンス/get_sidebar
の真ん中あたり、
一つのテーマで二つのサイドバーが使えます。
<?php get_header(); ?> <?php get_sidebar('left'); ?> <?php get_sidebar('right'); ?> <?php get_footer(); ?>
この場合、右サイドバーと左サイドバーのファイル名は、それぞれ sidebar-right.php と sidebar-left.php にします。
とある。sidebarが複数ある時は、
<?php get_sidebar(' '); ?>
‘ ’の中にファイル名 sidebar-xxx.phpの-以下を記述
参考サイト
WordPress「Warning: Use of undefined constant …」ってエラーが表示されていたので直してみた