Give includes a number of useful shortcodes that will help you customize your giving experience. In this section we outline each shortcode, it’s usage, and customization options.
Give Shortcodes – the shortcode builder
The best way to add shortcodes to your posts/pages of your websites using Give is through the shortcode builder. It is the quickest way to add a shortcode without worrying about the syntax and attributes going wrong.
You can find the shortcode builder – “Give Shortcodes” beside the “Add Media” button above the WP Editor.
Click on the shortcode builder button and choose the shortcode you want to create from the list in the dropdown.
Each option in that dropdown has its own article above, describing in detail how the attributes work, as applicable. The following text explains a common use-case for the shortcode builder, the
[give_form] shortcode. The other shortcodes available in the builder exhibit similar behavior and options.
Selecting “Donation Form” produces a lightbox with the following options to choose from:
Select a Donation form (required) — Choose the donation form you want to create a shortcode for.
Once you’ve chosen your form, you’ll see other optional settings you can set for the Donation form shortcode.
Show Title — optionally show/hide the form title. Default is “true”.
Show Goal — optionally show/hide the form goal, if applicable. Default is “true” for forms with a goal, and this parameter will have no effect on forms without a goal.
Display Content — optionally show/hide the form content. You can choose from None, Below, or Above. This will override the default settings of the form. The Default value is whatever you chose when you created the form.
Display Options — this is the Display mode setting. Optionally override the setting you set when you created the form. You can choose from “All Fields” to display all fields on the page when it loads, “Modal” to display fields in a modal button that shows only the title and total before clicking the button, “Reveal” which shows all fields on the page after a click, or “Button only” which puts all fields within the modal, and only has the “Donate Now” button visible.
Once you are done working on the optional settings, you can click on “Insert Shortcode” button to insert the shortcode to the post/page. Once it is added to the post/page you can publish it or can copy/paste it to different part of the content or anywhere in the site.
Understanding Shortcode Attributes
Each of the linked articles at the top of this article walks through shortcodes that Give provides with descriptions of their available attributes. Keep in mind that the shortcode builder is the easiest way to generate your shortcode, but then you can copy and paste it anywhere on your website.
Since WordPress 4.9, you can also paste your shortcode directly into a HTML widget. Keep in mind that we also have a Give widget that might produce better results (for the
[give_form] shortcode) for you as well.
Lastly, if you want to output your shortcode programmatically, either directly in your theme template files or via a functionality plugin, you can also use the “do_shortcode” function like so:
echo do_shortcode('[give_form id="87"]');