How to Display a List of WPForms Using a Shortcode

/** * Create shortcode to display all form titles in a list. * * Basic usage: [wpforms_all_forms] * * @link https://wpforms.com/developers/how-to-display-a-list-of-wpforms-using-a-shortcode/ */ add_shortcode(‘wpforms_all_forms’, function() { $args = [ ‘post_type’ => ‘wpforms’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ]; $posts =…Continue reading

How to Change the Error Text for Failed Submissions

/** * Change the error text message that appears. * * @link https://wpforms.com/developers/how-to-change-the-error-text-for-failed-submissions/ */ function wpf_translated($translated_text, $text, $domain) { // Bail early if it’s not a WPForms string. if ($domain !== ‘wpforms-lite’) { return $translated_text; } // Compare against the…Continue reading

Remove Multiple Fields From {all_fields} in Notifications

/** * Remove Specific Fields from Notifications * * @link https://wpforms.com/developers/how-to-remove-specific-fields-from-notifications */ add_action(‘wpforms_loaded’, function() { add_filter(‘wpforms_entry_email_data’, function ($fields, $entry, $form_data) { // Bail early if form ID is not equal to 1000 if ((int)$form_data[‘id’] !== 1000) { return $fields; }…Continue reading

To Remove a Single Field From {all_fields}

/** * Remove Specific Fields from Notifications * * @link https://wpforms.com/developers/how-to-remove-specific-fields-from-notifications */ add_action(‘wpforms_loaded’, function() { add_filter(‘wpforms_entry_email_data’, function ($fields, $entry, $form_data) { // Bail early if form ID is not equal to 1000 if ((int)$form_data[‘id’] !== 1000) { return $fields; }…Continue reading

Changing the Submit Button Color

.wpforms-form button[type=submit] { background-color: #024488 !important; border-color: #024488 !important; color: #fff !important; transition: background 0.3s ease-in-out; } .wpforms-form button[type=submit]:hover { background-color: #022B57 !important; }Continue reading

Centering All Form Elements

/* Center the form container */ .wpforms-container.wpf-center { margin: 0 auto !important; max-width: 500px !important; width: 500px !important; } /* Center submit button and make it full width */ .wpf-center .wpforms-submit-container { display: inline-block; text-align: center; width: 100% !important; }…Continue reading

How to Center a Form

.wpforms-container.wpf-center { margin: 0 auto !important; /* Adjust the width in the next 2 lines as your site needs */ max-width: 500px !important; width: 500px !important; } /* Readjust the form width for smaller devices */ @media only screen and…Continue reading