So instead of using get_search_form(), we add our own custom form markup. This is useful when you want to display a variation of your theme’s default search form. Notice that we are using home_url() for the value of the action attribute.

Display the search form

Once you have added the custom function to your theme’s functions.php file, you can display the search form on any WP Post or Page by simply adding the following shortcode:

[display_search_form]

That’s all there is to it. Feel free to customize the shortcode function to suit your specific needs. Cheers :)