Skip to content

Instantly share code, notes, and snippets.

@Stoltze
Last active February 6, 2017 14:21
Show Gist options
  • Save Stoltze/5199418c4d216886916c0dcd7f9eaf2e to your computer and use it in GitHub Desktop.
Save Stoltze/5199418c4d216886916c0dcd7f9eaf2e to your computer and use it in GitHub Desktop.
Inline Form in Gravity Forms (for newsletter sign up)
<!-- Place this code in your functions.php, to enable to function to disable/remove field labels -->
<?php add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' ); ?>
<!-- Place this code in the bottom of page.php -->
<div class="wpb_row vc_row vc_row-fluid mk-fullwidth-true attched-false inline-formular-wrap">
<div class="mk-grid">
<div style="" class="vc_col-sm-12 wpb_column column_container _ height-full">
<div id="text-block-2" class="mk-text-block ">
<h4 style="text-align: center;">
Tilmeld dig nyhedsbrevet
</h4>
<div class="clearboth"></div>
</div>
<div class="text-center">
<?php
gravity_form( 3, false, false, false, "", true, 12 );
?>
</div>
</div>
</div>
</div>
<!-- Place this in your stylesheet -->
<style>
/* Gravity Forms Inline Formular */
.inline-formular-wrap {padding: 20px 0;background:#f7f7f7;}
.inline-formular {text-align: center!important}
.inline-formular .gform_body {width:25%!important;display: inline-block!important;}
.inline-formular .gform_footer {width: 10%!important;display: inline-block!important;text-align: left!important;margin: 0!important;padding: 0!important;}
.inline-formular .gform_body ul li {padding: 0!important;margin: 0!important;}
.inline-formular .gform_body ul li input {margin: 0!important;padding: 10px 10px!important;line-height: 15px!important;border: 1px solid #fff!important;}
.inline-formular .gform_body ul li .ginput_container {margin: 0!important;}
.inline-formular .gform_body ul {float:left!important;width:100%!important;}
.inline-formular .gform_footer input {float: left!important;display: block!important;width: 100%!important;}
@media only screen and (max-width: 900px) {
.inline-formular .gform_body {width: 40%!important;}
.inline-formular .gform_footer {width: 20%!important}
}
@media only screen and (max-width: 641px) {
.inline-formular .gform_body {width: 100%!important;}
.inline-formular .gform_footer {width: 100%!important}
.inline-formular {padding:0 20px;}
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment