Support » Plugin: ACF Field For Contact Form 7 » Is it possible to add custom html id and css?

  • Resolved cheerfulgirl

    (@cheerfulgirl)


    Here is my original CF7 short-code

    <?php echo do_shortcode('[contact-form-7 id="979" title="Contact form" html_id="contact-form" html_class="form-validate form-horizontal"]'); ?>

    Since there are more than one form in my website, therefore I choose to use this plugin, however the class and id will be lose, is it able to insert the html_id and html_class via this plugin?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author KrishaWeb

    (@krishaweb)

    Hello @cheerfulgirl

    Add below code in functions.php
    add_filter( 'acf_cf7_object', '__return_true' );

    And you can use the below code in theme file to get the thing which you want.

    $form = get_field( 'contact_form_7' );
    echo do_shortcode('[contact-form-7 id="' . $form->id() . '" title="' . $form->title() . '" html_id="contact-form" html_class="form-validate form-horizontal"]');

    Let me know whether it works or not.

    Thanks

    Thread Starter cheerfulgirl

    (@cheerfulgirl)

    It works perfectly! Thanks!

    Plugin Author KrishaWeb

    (@krishaweb)

    Hello @cheerfulgirl

    We are glad that the plugin is working perfectly fine now. Feel free to reach us if you need any further support from our end.

    Meanwhile, if you can provide us your feedback and review for the plugin at https://wordpress.org/support/plugin/acf-field-for-contact-form-7/reviews/ that would be great.

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is it possible to add custom html id and css?’ is closed to new replies.