Skip to content

Instantly share code, notes, and snippets.

@stephanie-walter
Last active December 12, 2015 00:58
Show Gist options
  • Save stephanie-walter/4687341 to your computer and use it in GitHub Desktop.
Save stephanie-walter/4687341 to your computer and use it in GitHub Desktop.
WP CF7 Revamp
/* in function */
function my_deregister_javascript() {
/**adding some cleanup for plugin **/
if (!is_page('contact')){
wp_deregister_script( 'jquery-form' );
}
}
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
/** Cleaning up CSS styles **** */
function my_deregister_styles() {
/**adding some cleanup for plugin **/
wp_deregister_style( 'contact-form-7' );
}
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
/* inside the form itsef, clean HTML */
<p><label for="name">Votre nom*</label></p>
<p> [text* name id:name] </p>
<p><label for="email">Votre email*</label></p>
<p> [email* email id:email] </p>
<p><label for="subject">Sujet</label></p>
<p>[text subject id:subject] </p>
<p><label for="message">Votre message</label></p>
<p>[textarea message id:message] </p>
<p>[submit "Envoyer"]</p>
/** le CSS ***/
/* wpcf7 form */
.wpcf7 p{
margin-bottom:10px;
}
.wpcf7 input,
.wpcf7 textarea{
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
-ms-box-sizing:border-box;
box-sizing:border-box;
width:100%;
display:block;
padding:10px;
height:40px;
}
.wpcf7 textarea{
height:auto;
}
.wpcf7 input.wpcf7-submit{
width:auto;
float:right;
background:rgb(11, 68, 97);
color:#fff;
font-size:15px;
}
.wpcf7-not-valid-tip,
.wpcf7-mail-sent-ng{
color:rgb(243, 104, 53);
font-style:italic;
}
.wpcf7-mail-sent-ok{
color:rgb(9, 99, 8);
font-style:italic;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment