The [give_totals] shortcode allows you to display the earnings from multiple forms on your site. Multiple goals can be rolled into one and displayed with or without a progress bar. This documentation walks you through the various options and attributes that can be included there.

You may need to display the total current progress of a given form or collection of forms whether they have a progress bar enabled on them individually or not. The [give_totals] shortcode is made to enable you to do exactly that. You can display a combined total of any number of forms by listing their IDs, or by category or tag. You can additionally show a progress bar based on any total amount you designate with your own custom messaging as well. This is a very useful, practical, and flexible shortcode that you’ll find many uses for.

Screenshot showing the GiveWP shortcode builder modal open, with the give_totals options shown clearly.
The give_totals options within the GiveWP shortcode builder modal.

Using the Shortcode Builder with give_totals

The GiveWP shortcode builder allows you to generate the shortcode to your exact specifications. Within the builder you’ll have the following options:

  • Donation Form IDs: Use this to list your GiveWP form IDs that you want to combine for the total. IDs must be comma separated.
    • Shortcode attribute: ids
    • Attribute values: numerical values only, comma-separated.
  • Total Goal: Set any numerical value you want as your total goal amount.
    • Shortcode attribute: total_goal
    • Attribute value: any numerical value you would like.
  • Message: This is the inline text message to display your totals.
    • Shortcode attribute: message
    • Attribute value: Any text you would like. To display the dynamic information of the total and the goal use {total} and {total_goal} respectively.
  • Link: If this is filled with a URL, a hyperlink will appear to encourage readers to go and donate.
    • Shortcode attribute: link
    • Attribute value: Any full URL, including “https://” and/or “www” if necessary.
  • Show Progress Bar: This will output a progress bar, styled like our GiveWP progress bars. If you choose to show it, it will appear regardless of whether your forms have a progress bar enabled individually or not.
    • Shortcode attribute: progress_bar
    • Attribute values: true (default), false

Additional GiveWP Totals Shortcode Attributes

There are some additional attributes that are not exposed in the shortcode builder that can be powerful as well:

  • Categories: Display totals of a whole category or categories of forms.
    • Shortcode attribute: cats
    • Attribute values: A comma separated list of GiveWP form category ids that you want to combine into one total.
  • Tags: Display totals of all forms with specific tags.
    • Shortcode attribute: tags
    • Attribute values: A comma separated list of GiveWP form tag ids that you want to combine into one total.
Note: All attributes are optional for use with the GiveWP Totals Shortcode. However, if you’re outputting the default message that includes a goal amount, you’ll also need to use total_goal attribute.

Example Give_Totals Implementations

Here are some detailed examples of ways you can implement the GiveWP Totals feature with the shortcode either manually or via the Shortcode Builder:

EXAMPLE: Default Output

None of the shortcode attributes are technically “required.” If you simply type [give_totals] into a page or post, you will get the following example:

The give_totals default output

Note that because the total_goal is not set the message is awkward. With that in mind, it’s best to either set a goal with the total_goal attribute, or set a message (with the message attribute) that does not include the {total_goal} dynamic output. Note also that though the progress_bar default is “true” it cannot be displayed above because there is no total for the progress to be compared against.

EXAMPLE: Basic Configuration

This is an example of a very basic configuration with only the total_goal attribute configured.

The GiveWP Totals shortcode with only the total_goal attribute set

[give_totals total_goal="50000"]

The output of the give_totals shortocde with the total_goal being set at $50,000. This now properly shows a progress bar with its progress and the total goal amount.

Note how this adds the progress bar and the amount raised now makes sense in the context of the goal set.

EXAMPLE: Text only within a Cover Block

Because the output of the totals is very simple, it can be used in a wide variety of ways to great effect. Below is an example of embedded the totals within a “Cover block“.

Text-only for specific Form IDs + Cover Block

[give_totals ids="984,986" message="Thanks to you, we’ve raised {total} across all our congregations combined! Let's keep it up!" progress_bar="false"]

The totals displayed within a cover block with the message: Thanks to you, we’ve raised $6,309 across all our congregations combined! Let's keep it up!

EXAMPLE: Text only of Totals + Custom Message

If you’d like to have quick display total of all of your forms via text with a custom message, use this shortcode and edit the custom message to your liking. Be sure to include the “{total}” in your message.

Text Block For All Forms + Custom Message

[give_totals  message="We're so excited to have raised {total} across all of our donation campaigns. We appreciate your continued support!" progress_bar="false"]

GiveWP totals shortcode with block of text only for all donation forms