はじめまして!WEB制作会社で働いている現役エンジニアです。 今回はWordPressの固定ページでphpコードを書く方法をご紹介します。 WordPressの固定ページでphpコードを書く方法 WordPressの固定ページでphpコードを書いても実行されません。 ではどうやってphpを書けば良いのか? それはショートコードを使い別ファイルを読み込みそこにphpの処理を書けば実行されます。 ではどうやってやるのか解説していきます。 functions.phpにコードを記載 functions.phpに下記のコードを書いてください。 function include_my_php($params = array()) { extract(shortcode_atts(array( 'file' => 'default' ), $params)); ob_start(); include(g