The [campaigns] shortcode
campaigns shortcode allows you to display a collection of campaigns within your posts or pages.
number: The number of campaigns to show. Set this to
-1to show all campaigns. Defaults to the number of posts you show on blog pages.
orderby: The order in which campaigns are displayed. Options include
ending. As of version 1.4, you can also use any of the options that
WP_Queryaccepts. Defaults to
order: Change the direction in which campaigns are ordered. Accepts
ASC. Defaults to
category: Only show campaigns within certain categories.
creator: Only show campaigns created by a certain user. User must have their user ID passed.
exclude: Exclude specific campaigns by their ID. Pass multiple IDs as a comma separated list to exclude more than one.
include_inactive: Include campaigns that have expired by setting this to
true. Defaults to
columns: Choose how many columns you want to display the campaigns in. Supports any number between 1 and 4. Defaults to
button: Choose whether you want to show a Donate button (the default), a read more link (
button="details"), or nothing at all (
id: Show specific campaigns. You can provide a single number or multiple IDs as a comma separated list.
responsive: Scale campaigns to a single-column layout on smaller screens. Set this to
0to turn off the responsive behaviour, or specify a custom breakpoint with a px or em value. The default breakpoint is
masonry: Display the campaigns in a masonry layout (like Pinterest). Set this to
1to enable the masonry layout. Defaults to
In addition, if you have Campaigns Geolocation installed, you can display campaigns on a Google Map, with some additional parameters:
map: Set to
trueto display campaigns on a map. Defaults to
width: Set how wide you want your map to be. This must be passed as a valid CSS width (400px, 100%, etc). Defaults to
height: Set how high you want your map to be. This must be passed as a valid CSS height. Defaults to
zoom: Set the initial zoom level you would like your map to display at. Defaults to
auto, with the zoom level based on the pins that have been added to the map.
Include expired campaigns:
Show 30 campaigns:
Order campaigns by the amount of money they have raised:
Order campaigns by how soon they are ending (soonest to end is shown first):
Only show campaigns within the “environmental issues” category:
Only show campaigns by the user with ID 33:
Display campaigns in 3 columns:
Show a “read more” link for campaigns:
Only display the campaigns with IDs of 33 and 44:
Turn off responsive styling:
Set a custom breakpoint of 600px for responsive styling:
Display campaigns on a map width a width of 900px, height of 600px and zoom level set to 5 (requires Charitable Geolocation):
[campaigns map=1 width=900px height=600px zoom=5]