Skip to content

Instantly share code, notes, and snippets.

@hansspiess
Created August 17, 2012 14:28
Show Gist options
  • Save hansspiess/3379145 to your computer and use it in GitHub Desktop.
Save hansspiess/3379145 to your computer and use it in GitHub Desktop.
Wordpress: Add custom Class to Contact Form 7 <form> tag
<?php
add_filter( 'wpcf7_form_class_attr', 'custom_custom_form_class_attr' );
function custom_custom_form_class_attr( $class ) {
$class .= ' nice';
return $class;
}
?>
@jasson112
Copy link

Please check this link: http://contactform7.com/faq/can-i-add-id-and-class-attributes-to-a-form-element/
This will give you overall information what you want.

Form specific:
[contact-form-7 id="1234" title="Contact form 1" html_id="contact-form-1234" html_class="form contact-form"]
Field specific:
[text* first-name class:full class:field placeholder "FIRST NAME"]

Ty ! it works for me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment