Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] Adding class to form

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    wpcf7_form_class_attr filter is available. Add this code to your theme’s functions.php.

    add_filter( 'wpcf7_form_class_attr', 'your_custom_form_class_attr' );
    
    function your_custom_form_class_attr( $class ) {
    	$class .= ' foo bar';
    	return $class;
    }

    Takayuki Thanx, it works 🙂
    But what about if I need also to add a class to the button?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    For each field in a form, you can add ‘class:’ option in the tag.

    Example:
    [text* your-name 20/40 class:required "John Smith"]

    See docs.
    Text Fields

    what code do I add to this to move the box to the right?

    `[select your-country class:class-name1 “Australia” “Brazil” “Canada” “Denmark” “Finland”]

    Thanks

    .class-name1 {
    float:right;
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Contact Form 7] Adding class to form’ is closed to new replies.