前提・実現したいこと
以下のサイトの方法でWordPressで閲覧履歴を表示させたいです。
https://oku-log.com/blog/wordpress-cache/
発生している問題・エラーメッセージ
(functions.php) で以下のエラーが発生しました。
wp-content/themes/twentyseventeen_child/functions.php ファイルの70行目のエラーのため、PHP コードの変更をロールバックしました。修正し、もう一度保存してください。 Uncaught Error: Call to undefined function get_field() in wp-content/themes/twentyseventeen_child/functions.php:70 Stack trace: #0 wp-content/themes/twentyseventeen/footer.php(79): readpost_typecheack(5) #1 wp-includes/template.php(688): require_once('/home/xhogex/...') #2 wp-includes/template.php(647): load_template('/home/xhogex/...', true) #3 wp-includes/general-template.php(76): locate_template(Array, true) #4 wp-content/themes/twentyseventeen/index.php(67): get_footer() #5 wp-includes/template-loader.php(74): include('/home/xhogex/...') #6 wp-blog-header.php(19): require_once('/home/xhogex/...')
該当のソースコード
70行目。
<img src="<?php echo get_field('image',$val); ?>" alt="">
試したこと
<?php echo get_field('image',$val); ?> を削除すれば、エラーは消えましたが、サムネイルが表示されません。仮に、http://example.com/img/test-200x150.jpg とすれば、画像がひょうじされるので、
画像の取得・書き出し方、もしくは、WPの設定???などに問題があるのだと思うのですが、、、、、
補足情報(FW/ツールのバージョンなど)
関係があるかわかりませんが、
xserverを使用していて、エラー部分の xhogex は サーバーID 兼 FTPユーザー名と一致します。
wpは以下にインストールしてあります。
www.example.com/test/wp/
ftpURLは下記です。
ftp://sv0000.xserver.jp/example.com/public_html/test/wp/
よろしくお願いします。