This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Register widget areas | |
genesis_register_sidebar( array( | |
'id' => 'parallax-section-below-header', | |
'name' => __( 'Parallax Section Below Header', 'your-theme-slug' ), | |
'description' => __( 'This is the parallax section below header.', 'your-theme-slug' ), | |
) ); | |
genesis_register_sidebar( array( | |
'id' => 'parallax-section-above-footer', | |
'name' => __( 'Parallax Section Above Footer', 'your-theme-slug' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are the detailed steps on how to add/create a unique order id for specific form. | |
An order id can be of any format, for demonstration purposes our format would be, | |
XXX-AAAYYMMDDHHMMSS - change XXX and AAA to your own preferences. | |
Step 1: Create new form. | |
Step 2: Add single field | |
Label: ORDER ID | |
Goto Advance Tab -> Visibility -> Administrative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste code from `gform-math-captcha.txt` in your current themes functions.php | |
// Then add an HTML field in gravityform where you want to have a math captcha | |
// Then add the shortcode: [math-captcha form=yourformID] | |
-How it works? | |
// Submit button will be disabled by default, and will be enabled when entering the correct answer to a math equation. | |
add_shortcode('math-captcha', 'math_captcha'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// code placement: current themes functions.php | |
// code courtesy of https://techblog.willshouse.com/?p=5249 | |
// Remove `Map It` in email notification | |
add_filter('gform_pre_send_email', 'gform_pre_send_email_cb'); | |
function gform_pre_send_email_cb($email) { | |
// attempt to match the link using a regular expression | |
$test = preg_replace("#\<a [^>]+?\>Map It[^>]+\>#i", '', $email["message"]); | |
// if the result is not empty / blank, use it to replace the original html | |
if(trim($test)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="panel panel-primary"> | |
<div class="panel-heading"></div> | |
<div class="panel-body"> | |
<h2>Thank You.</h2> | |
<p>Your order was successful with an order id of <strong>{ORDER ID:294}</strong>.</p> | |
<p> | |
<a class="btn btn-default btn-md" role="button" href="/">Order Again</a> | |
<a class="btn btn-primary btn-md" role="button" href="http://pay.orderpayroll.com/order/{ORDER ID:294}">Pay Now</a> | |
</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*******/ | |
class GF_Field_SIN extends GF_Field { | |
public $type = 'sin'; | |
public function get_form_editor_field_title() { | |
return esc_attr__( 'SIN', 'gravityforms' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docs: https://docs.gravityforms.com/gform_display_product_summary/ | |
# Disable for all forms | |
add_filter( 'gform_display_product_summary', '__return_false' ); | |
# Disable for a specific form | |
add_filter( 'gform_display_product_summary', function( $display_product_summary, $field, $form, $entry ) { | |
return $form['id'] == 10 ? false : $display_product_summary; | |
}, 10, 4 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Limit maximum year to current year | |
add_filter( 'gform_date_max_year', 'set_max_year' ); | |
function set_max_year( $max_year ) { | |
return date('Y', current_time('timestamp')); | |
} | |
// Reference: https://www.gravityhelp.com/documentation/article/gform_date_max_year/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code placement: current theme functions.php | |
// Change date displayed format. | |
// Example adding a date field in a dropdown/datefield format is dd-mm-yy and value `09-09-2017`, | |
// By adding this filter it will display as `09-September-2017`. | |
// Take note that in gforms docs: https://www.gravityhelp.com/documentation/article/gform_merge_tag_filter/#5-date-field | |
// priority is `10` and is working only for datepicker but not for dropdown and datefield, | |
// here is changed to `15` to ensure filter would not be overriden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getUrlParameter(name) { | |
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); | |
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); | |
var results = regex.exec(location.search); | |
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); | |
}; | |
Reference: https://davidwalsh.name/query-string-javascript | |
How to use ? | |
// Assuming "?post=1234&action=edit" |
OlderNewer