Skip to content

Instantly share code, notes, and snippets.

@intelliweb
Created April 9, 2013 03:30
Show Gist options
  • Save intelliweb/5342745 to your computer and use it in GitHub Desktop.
Save intelliweb/5342745 to your computer and use it in GitHub Desktop.
Gravity Forms: Move field descriptions above fields. Make sure to place this snippet AFTER where jQuery is enqueued (right before the </ head> tag is good). The description CSS may need to be tweaked to change margins, padding depending on theme and preferences. Source: http://www.gravityhelp.com/forums/topic/request-setting-to-place-field-descr…
<?php
function intw_gf_sublabels() {
if( is_page(39) ) { ?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.ginput_complex label').each(function(i,e){
sublabel = jQuery('<label>').append(jQuery(e).clone()).remove().html();
jQuery(e).siblings().after(sublabel);
jQuery(e).remove();
});
});
</script>
<?php }
}
add_action('wp_head', 'intw_gf_sublabels');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment