vkfiltersearch
・一旦Classicエディタを解除
・ブロックエディタで「+」下の方のVK Filter Searchをクリック
・VK Filter Search新規投稿「名前を決める」=★決めた名前★
設置したいところに書く
<div class="vfs">
<?php
$form_title = 'vkfiltersearch'; // 投稿タイプ VK Filter Search に登録したフォームのタイトル名
$query = new WP_Query(
array(
'post_type' => 'filter-search',
'name' => $form_title,
)
);
if ( $query->have_posts() ) {
$post = $query->posts[0];
if ( ! empty( $post->post_content ) ) {
echo apply_filters( 'the_content', $post->post_content );
}
}
wp_reset_postdata(); // カスタムクエリ後にグローバル$postオブジェクトをリセット
?>
</div>
.vfs{
max-width:800px;
margin:10px auto;
border:1px solid #111111;
}