• Resolved jconnor3349

    (@jconnor3349)


    Hello Looking for a little help. I was using this plugin in with my contact forms 7 but I cant figure out where this bit of code should go. Basically I am trying to change the form properties from default to inline.

    function newsinline( $properties ) { $properties['layout'] = 'inline'; return $properties; }

    I put that code in additional settings, which nothing happened. Does any one know how/where I need to add this code for the desired change?
    An example would be very helpful. Thanks

    https://wordpress.org/plugins/bootstrap-for-contact-form-7/

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

    (@flixos90)

    You need to hook the function into the necessary filter as described in the FAQ section of the plugin page.

    If you want to change the layout for all forms on your entire site, you have to put the above function and the following line into a PHP file that is executed on the site, for example into your theme’s functions.php.
    add_filter( 'cf7bs_default_form_properties', 'newsinline' );

    If you only want to apply this layout to a specific form, you have to figure out the form’s ID (you can see it when editing the form) and use the following code:
    add_filter( 'cf7bs_form_' . $form_id . '_properties', 'newsinline' ); where you replace $form_id by the form’s ID

    Hi there, can you please confirm if this is right, I’m having issues:

    if I wanted to edit the checkbox options from default to inline on specific contact form, example form id 4567, then I have to paste the following:

    add_filter( ‘cf7bs_form_’ . 4567 . ‘_properties’, ‘newsinline’ );

    into my theme’s functions.php

    Is this correct?

    Plugin Author Felix Arntz

    (@flixos90)

    Hi purfitt,

    yes, that is correct, but be careful to provide the function newsinline() too. Whatever you choose as the second parameter for the add_filter() call must be the name of the function as well. I would advise you to use a more specific name than ‘newsinline’, for example by prefixing it, to prevent possible conflicts with another function of that name.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bootstrap for Contact Form 7 Changing Properties of Layout to Inline’ is closed to new replies.