how to integrate gravity forms in wordpress theme using form id

To integrate Gravity Forms in a WordPress theme using the form ID, follow these steps:

  1. Open the WordPress dashboard and navigate to "Appearance" > "Editor."

  2. Select the theme where you want to integrate the Gravity Form.

  3. Locate the "functions.php" file and add the following code:

add_shortcode( 'display_gravity_form', 'display_gravity_form_function' );
function display_gravity_form_function( $atts ) {
    extract( shortcode_atts( array(
        'id' => '',
    ), $atts ) );

    return gravity_form( $id, false, false, false, '', true, 1 );
}
  1. Save the changes to the "functions.php" file.

  2. Now, go to the page where you want to display the form and insert the following shortcode:

[display_gravity_form id="your_form_id"]

Replace "your_form_id" with the actual ID of your Gravity Form.

  1. Save the page and view it to see the integrated Gravity Form in your WordPress theme.