How to use other shortcodes inside Contact form 7- forms? [closed]

There’s two ways to do what you’re wanting. First way is to add this code to functions.php of the Contact Form 7 plugin:

add_filter( 'wpcf7_form_elements', 'mycustom_wpcf7_form_elements' );

function mycustom_wpcf7_form_elements( $form ) {
$form = do_shortcode( $form );

return $form;
}

That allows you to drop shortcodes directly into CF7. Second is to add the Accordion in manually with HTML in the contact form, like this:

<!-- begin class .wp-accordion -->
<div class="wp-accordion wpui-light">

    <!-- First tab's panel -->
    <h3 class="wp-tab-title">Tab 1</h3>
    <!-- First tab's contents -->
    <div class="wp-tab-content">
          All the contents of first tab goes here....
    </div><!-- end first tab -->

      <!-- Like so, Second panel -->
      <h3 class="wp-tab-title">Tab 2</h3>
      <div class="wp-tab-content">
            Contents of the second tab
       </div>

</div><!-- end class wp-accordion -->

I think the second method is preferable, since there is no modifying of core plugin files. I hope this helps out!

Leave a Comment