Skip to content

Instantly share code, notes, and snippets.

View register-widgets-minimum.php
<?php
//* Do NOT include the opening php tag
genesis_register_sidebar( array(
'id' => 'welcome',
'name' => __( 'Welcome', 'minimum' ),
'description' => __( 'This is the Welcome section of the homepage.', 'minimum' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom-message',
View front-page-function-minimum.php
<?php
//* Do NOT include the opening php tag
/* Display widget content for "welcome" section.
------------------------------------------------- */
function minimum_home_loop_helper_top() {
genesis_widget_area( 'welcome', array(
View add-widgets-front-page.php
<?php
//* Do NOT include the opening php tag
//* Add Home Widget areas
add_action( 'genesis_after_header', 'minimum_home_loop_helper_top', 15 );
add_action( 'genesis_after_header', 'minimum_home_featured', 15 );
add_action( 'genesis_after_header', 'minimum_home_loop_helper_bottom', 15 );
View minimum-style.css
/* Welcome
--------------------------------------------- */
.welcome {
background: #fff;
clear: both;
}
.welcome .wrap {
color: #333;
@chrisegg
chrisegg / Gravity_Forms_Field_Label_Visibility.php
Last active Jun 24, 2016
Gravity Forms Field Label Visibility
View Gravity_Forms_Field_Label_Visibility.php
<?php
//* Do NOT include the opening php tag
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );
@chrisegg
chrisegg / radio-button-submit
Last active Dec 25, 2020
This snippet will allow you to use a radio button field to submit the form without using the submit button.
View radio-button-submit
<script>
 jQuery(document).ready(function($) {
 $('input[type=radio]').on('change', function() {
 $(this).closest("form").submit();
 });
});
</script>
@chrisegg
chrisegg / gforms_remove_button
Last active Jan 26, 2021
Replace the ID with your form ID number. Place this code in you functions.php file or a custom functions plugin
View gforms_remove_button
// Replace ID with your forms ID number.
add_filter( 'gform_submit_button_ID', '__return_false' );
View notifications_attach_file.php
<?php
// Do NOT include the opening php tag
// Replace 1 with your forms ID
// Replace User Notification with the name of your notification
// Insert your file path
add_filter( 'gform_notification_1', 'add_notification_attachments', 10, 3 );
function add_notification_attachments( $notification, $form, $entry ) {
if ( $notification['name'] == 'User Notification' ) {
$path = 'path/to/file.pdf';
View hide_submit_button.css
// Replace ID with your forms ID number.
body #gform_wrapper_ID .gform_footer input[type=submit] {
visibility: hidden;
}
@chrisegg
chrisegg / gravity_forms_readonly.js
Last active Aug 18, 2021
This code snippet works for text input fields only and can be placed in an HTML field within your form.
View gravity_forms_readonly.js
<script type="text/javascript">
jQuery(document).ready(function(){
/* apply only to a input with a class of gf_readonly */
jQuery(".gf_readonly input").attr("readonly","readonly");
});
</script>