Skip to content

Instantly share code, notes, and snippets.

@johnchandler
Created August 6, 2013 23:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnchandler/6169615 to your computer and use it in GitHub Desktop.
Save johnchandler/6169615 to your computer and use it in GitHub Desktop.
<?php
//Setup data to include in the form
if ( have_posts() ) while ( have_posts() ) : the_post();
$child_name=get_the_title();
$child_id=get_field('listing_code');
$sponsor_count = get_field('sponsors');
if (h1n_in_taxonomy('status', 'orphaned') || h1n_in_taxonomy('status', 'teacher')) {
$slots=5;
}
else {
$slots=2;
}
$available=$slots-$sponsor_count;
//Embed the form
echo do_shortcode('[gravityform id="9" title="false" description="false" ajax="true" field_values="child_name=' . $child_name . '&child_id=' . $child_id . '"]');
gravity_form(9, false, false, false, array('child_name' => $child_name, 'child_id' => $child_id ), true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment