Use the [coupon] shortcode to display one coupon or a simple list of published coupons anywhere WordPress runs shortcodes.
Common examples #
Show one coupon:
[coupon couponid="123"]
Show the four most recently published coupons:
[coupon totalcoupons="4"]
Show four coupons from the dining category, ordered by title:
[coupon totalcoupons="4" category="dining" couponorderby="title"]
Attributes #
| Attribute | Default | What it does |
|---|---|---|
couponid |
Empty | Displays one coupon by its numeric WordPress post ID. |
totalcoupons |
50 when omitted |
Sets the maximum number of coupons in a list. Use -1 explicitly to show every matching coupon. |
category |
Empty | Limits a list to one Coupon Category slug. |
couponorderby |
date |
Sets the WordPress query order field. Common values are date, title, modified, ID, and rand. |
coupon_align |
cctor_alignnone |
Uses cctor_alignleft, cctor_aligncenter, cctor_alignright, or cctor_alignnone. |
bordertheme |
Empty | Passes a border-theme class to the coupon wrapper. Pro normally supplies this from the coupon's saved style. |
filterid |
Empty | Gives this shortcode a query-filter ID for developer customization. |
The shortcode shown in each coupon editor can also contain a name attribute. It is a readable label for administrators; the renderer does not use it to select or display the coupon.
List size and performance #
A bare [coupon] shortcode displays at most 50 published coupons. Earlier versions effectively showed every coupon, which could make a page slow on a large site. Set the amount explicitly when you need a different result:
[coupon totalcoupons="12"]
totalcoupons="-1" still shows every matching coupon, but it does not add pagination. For a large, browseable listing, use Coupon Creator Pro's [couponloop] shortcode instead; it provides pagination, columns, searching, sorting, and a filter bar. See Coupon Loop & Filter Bar.
Developer-scoped filtering #
filterid lets a developer change one shortcode query without affecting every coupon list. For example, [coupon totalcoupons="6" filterid="homepage"] applies the cctor_shortcode_query_args_homepage filter in addition to the global query filter.
See Filter the Shortcode Query for a working snippet and Displaying Coupons for the block and editor workflows.