• Resolved Ralf Koller

    (@rkoller)


    So far i’ve wrapped the shortcode with a form tag to apply custom classes:

    <form class="contact__labelinfo contact__form"><?php echo do_shortcode("[mc4wp_form]"); ?></form>

    but today the w3.org validator showed me that basically i’ve wrapped a form into a form ;))) But the question is would it be possible to somehow add those custom classes to the form tag of the shortcode? Cuz in the backend i am only able to change the content of the form tag but not the tag itself – or do i have to go with a div wrapper?

    i am running the standard version of the plugin in version 2.1.1 .

    Best regards Ralf

    https://wordpress.org/plugins/mailchimp-for-wp/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi Ralf,

    Yes, definitely. You can use the following function for that.

    add_filter( 'mc4wp_form_css_classes', 'my_mc4wp_form_classes' );
    
    function my_mc4wp_form_classes( $classes ) {
    	$classes[] 'my-class';
    	return $classes;
    }

    Hope that helps!

    Thread Starter Ralf Koller

    (@rkoller)

    Brilliant! Exactly what i was looking for! Works like a charm. Thanks a lot Danny!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Possible to add custom classes to the mailchimp form tag?’ is closed to new replies.