xxxxxxxxxx
// Create a shortcode for displaying the search form
function custom_search_form_shortcode($atts) {
ob_start(); // Start output buffering
get_search_form(); // Get the search form HTML
$search_form = ob_get_clean(); // Get the buffered content and clean the buffer
return $search_form; // Return the search form HTML
}
add_shortcode('custom_search', 'custom_search_form_shortcode');
//[custom_search]