Skip to content

Instantly share code, notes, and snippets.

@cfxd
cfxd / gf-input-group.less
Created October 6, 2014 05:29
Bootstrap 3 input group for Gravity Forms (only tested with 1 input field and 1 submit button)
/*
*
* Bootstrap 3 input group form for Gravity Forms
*
* Use with a class assigned to the form
* or on .gform to affect all Gravity forms
*
* Example 1 (affects targeted form class only): .my-form-class { &:extend(.gravity_form_input_group all); }
*
* Example 2 (affects all Gravity Forms): .gform { &:extend(.gravity_form_input_group all); }
@cfxd
cfxd / bs3-gravity-forms.less
Created October 6, 2014 05:31
Bootstrap 3 default styles for Gravity Forms (based on http://roots.io/style-gravity-forms-with-bootstrap/ and improved slightly)
/*
*
* Bootstrap 3 reset for Gravity Forms
*
*/
.gform_wrapper {
ul {
&:extend(.list-unstyled all);
margin: 0;
@cfxd
cfxd / bs3-contact-form-7.less
Last active June 8, 2021 07:29
Bootstrap 3 default styles for Contact Form 7
/*
*
* Bootstrap 3 reset for CF7
*
*/
input, textarea {
&.wpcf7-form-control {
&:extend(.form-control all);
&.wpcf7-validates-as-required.wpcf7-not-valid {
@cfxd
cfxd / cf7-input-group.less
Last active December 3, 2020 00:15
Bootstrap 3 input group for Contact Form 7 (only tested with 1 input field and 1 submit button)
/*
*
* Bootstrap 3 input group form for Contact Form 7
*
* In the shortcode, you must use html_id="my-id"
* or html_class="my-class" to target a specific form
*
* Actual form sample:
* <label for="your-email">Email:</label>
* [email* your-email 0/ placeholder "enter your email"]
@cfxd
cfxd / cf7-inline-form.less
Created October 6, 2014 06:42
Bootstrap 3 inline form for Contact Form 7 (only tested with 1 input field and 1 submit button)
/*
*
* Bootstrap 3 inline form for Contact Form 7
*
* In the shortcode, you must use html_id="my-id"
* or html_class="my-class" to target a specific form
*
* Actual form sample:
* <label for="your-email">Email:</label>
* [email* your-email 0/ placeholder "enter your email"]
@cfxd
cfxd / cf7-inline-form-full-width.less
Created October 6, 2014 06:47
Bootstrap 3 full width inline form for Contact Form 7 (only tested with 1 input field and 1 submit button)
/*
*
* Bootstrap 3 inline form *full width* for CF7
*
* In the shortcode, you must use html_id="my-id"
* or html_class="my-class" to target a specific form
*
* Actual form sample:
* <label for="your-email">Email:</label>
* [email* your-email 0/ placeholder "enter your email"]
@cfxd
cfxd / disable_gforms_auto_scroll.php
Last active August 29, 2015 14:07 — forked from rutger1140/gist:4994751
Disable auto scrolling of Gravity Forms
<?php
add_filter('gform_confirmation_anchor', '__return_false');
?>
@cfxd
cfxd / acf_select_gravity_forms.php
Last active August 15, 2016 04:12
Populate ACF Select Field with Gravity Forms
<?php
function populate_gravity_forms($field) {
echo '<h1>acf/load_field filter debug within populate_gravity_forms()</h1>';
if(class_exists('RGFormsModel')) {
$forms_array = array();
$forms = RGFormsModel::get_forms(null, 'title');
foreach($forms as $form) {
/*
*
* Assumes:
* 1. You have a FCF field called 'sections'
* 2. Each FCF block has a text sub field called 'section-title'
*
*/
<?php
<?php
function localize_ajax_variables() {
wp_localize_script('your_js', 'wp_ajax_vars', array(
'admin_url' => admin_url('admin-ajax.php')
));
}
add_action('wp_enqueue_scripts', 'localize_ajax_variables', 999);