I created a donation form like yours and embedded it here:
http://gravity.chrishajer.com/make-a-donation/
You can make a donation there. It is just a fake submission.
If you check the left sidebar, there is a widget at the bottom that holds the running total of donations. Check it before and after making a donation.
The widget holds this text:
[php]
[donations form=78]<br />
<a href="http://gravity.chrishajer.com/make-a-donation/" title="make a donation">Make a donation today</a>
I added this code to my theme's functions.php to retrieve all donations from one form, form 78 in my case: http://pastebin.com/qCWZfhdW
The code is commented. You will need to change the [3] in line 17 to your field ID (I believe it is field 5 in your donation form.) And when you use the shortcode, it will probably look like this, since I think yours is form 2:
[php]
[donations form=2]
The last line of that paste is required to process shortcodes in widgets, which WordPress does not do by default. You may or may not need that line, depending on where you insert this shortcode to show the total, and if your theme is already configured to process shortcodes in widgets. Try the code without it first, and if you don't see the output, but just the shortcode in brackets, then you need that line.
Please let us know if you have any questions.
Thanks.
Posted 12 years ago on Wednesday January 18, 2012 |
Permalink