Contact Form 7の入力フォームで郵便番号から住所を自動入力させる方法
function.phpに記述する方法は「wp_enqueue_script」がエラーになるので
header.phpのhead内に記述
<script src="https://yubinbango.github.io/yubinbango/yubinbango.js" charset="UTF-8"></script>
コンタクトフォームを固定ページに貼り付けるコードに「html_class=”h-adr”」を付ける
※ idの数字はその時々で違うのでセッティング時にコピペする
[contact-form-7 id="xxxx" title="お問い合わせフォーム" html_class="h-adr"]
コンタクトフォームの入力フォーム例
<label> 郵便番号
[text your-zip-code class:p-postal-code] 例)107-0052</label>
<label> ご住所(都道府県・市区町村)
[text your-address class:p-region class:p-locality class:p-street-address] </label>
<label> 番地・建物名など
[text your-address2 class:p-extended-address] </label>
郵便番号を3桁と4桁に分ける場合
〒[text your-zip-code class:p-postal-code maxlength:3] - [text your-zip-code2 class:p-postal-code maxlength:4]