Conditional Gravity Form Not Loading
-
I am using your plugin and it has been working great!
My only issue is that Gravity Forms that use conditional logic do not show up. However, forms without conditional logic work fine.
From what I understand, forms using conditional logic hide all of the fields and then use JS to display the initial set of fields. Obviously by loading the JS in the footer (as I am currently doing) this breaks the functionality.
But if I view the form’s page by adding
?ao_noptimize=1
to the end of the URL (i.e. domain.com/contact/?ao_noptimize=1) the form loads properly.I know that there are some Autoptimize snippets here: https://github.com/futtta/autoptimize/blob/master/autoptimize_helper.php_example
Would using the following snippet be the same as adding the querystring above?
/* autoptimize_filter_noptimize: stop autoptimize from optimizing, e.g. based on URL as in example @return: boolean, true or false */ // add_filter('autoptimize_filter_noptimize','my_ao_noptimize',10,0); function my_ao_noptimize() { if (strpos($_SERVER['REQUEST_URI'],'no-autoptimize-now')!==false) { return true; } else { return false; } }
If so, my question is how do I define the page(s) I want to use in that snippet to avoid using Autoptimize?
Thanks!
- The topic ‘Conditional Gravity Form Not Loading’ is closed to new replies.