Hello,
I'll try keep this short as it's a bit confusing. Any suggestions or advice would be really helpful. I think it's because I don't understand the internals of how these forms submit I can't figure it out. Here it goes...
I originally had to create a holding page theme. In this holding page theme, I had a gravity form which consisted of a name and email. This form is placed using short code...
<?php echo do_shortcode('[gravityform id="1" name="Subscribe Newsletter " title="false" description="true" ajax="true"]'); ?>
But I've now got to convert my holding page theme to a stand alone index.php file which is not a theme. How ever I still need my gravity form on the page.
This is so I can start building my main theme, and keep the holding page running separate from the wp installation, without actually moving the wp installation.
So I simply merged my theme header.php, index.php and footer.php into one file (index-temp.php), and I put this index-temp.php into my www root. I then added this php code at the top of the page...
<?php
define('WP_USE_THEMES', false);
require('wp/wp-load.php');
?>
This makes all my wordpress php based code work from the same installation, but as a stand alone file. Non theme based.
I had to use a cheeky bit of jquery on the stand alone version to change the form action attribute...
$("#gform_1").attr( "action", "/#gf_1" );
Please see links below...
- This is my original theme based holding page...
http://example.co.uk/ - This is my stand alone holding page...
http://example.co.uk/index-temp
As you can see, the forms on both pages work fine.
But if I remove the original theme based index.php, the form on the index-temp.php stops working? Nothing happens if you click 'Sign up' - I don't understand why removing the original index.php conflicts with the stand alone index-temp.php version?
I know it's a little off topic but if you can shed some light that would really helpful.
Thanks in advance.
Josh