現在のテンプレートファイル名の拡張子を除いた名前をbodyのidに設定したかったので、テンプレートファイル名を取得する方法を調べました。
WordPressのトップページとカテゴリページでデザインを変えたい場合などに役立つかと思います。
[php]global $template;
$template_file_name = basename($template, '.php');[…
update_field( 'フィールド名', '値', $post_id );参考 : https://developers.wano.co.jp/1373/
graffiti on the web
この投稿へのコメント
コメントはまだありません。