Are you trying to add the custom CSS class into WP Fluent Form’s <form> HTML markup? You can easily do it without editing the code plugin. There have a filter fluentform_form_class to add the custom class into <form> tag.
I am sharing the PHP snippet at below. You will put it into functions.php file of your theme.
Adding Custom Class to All Forms
1 2 3 4 5 6 |
add_filter( 'fluentform_form_class', 'paulc_fluentform_form_class', 10, 2 ); function paulc_fluentform_form_class( $formClass, $form ) { $formClass .= ' my-custom-form-class'; return $formClass; } |
Adding Custom Class to Specific Form
If you want to add the custom class into your specific form, you can try this code. You will replace form ID 2 with your form ID into the code. You will get the form ID here:
- Navigate to Dashboard -> Fluent Forms Pro -> All Forms page
- You will get list of forms
- There have a column ID
- Get the ID of your form
1 2 3 4 5 6 7 8 |
add_filter( 'fluentform_form_class', 'paulc_fluentform_form_class', 10, 2 ); function paulc_fluentform_form_class( $formClass, $form ) { if( $form->id == 2 ) { $formClass .= ' my-custom-form-class'; } return $formClass; } |
Leave a Reply