検索

// functions.php に追加
add_filter( ‘wp_nav_menu_items’, ‘add_search_box_to_menu’, 10, 2);
function add_search_box_to_menu( $items, $args ) {
if( $args->theme_location == ‘primary’ ){
return $items . ‘

  • ‘ . get_search_form(false) . ‘

‘;
}
}