Shortcodes
Shortcodes
Display raffle information anywhere on your site using shortcodes. Embed raffle cards, countdown timers, progress bars, and more in any page, post, or widget area.
Available shortcodes
| Shortcode | Description |
|---|---|
[raffle_card] | Full product card with image, countdown, prize, and CTA |
[raffle_cards] | Responsive multi-card grid |
[raffle_countdown] | Countdown timer |
[raffle_progress] | Ticket sales progress bar |
[raffle_prize] | Prize information display |
[raffle_status] | Status badge |
[raffle_card]
Displays a single raffle product card with image, countdown, prize details, and a "Buy Ticket" button.
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
id | Product ID, latest, active | Auto-detect | Which raffle to show |
Examples
[raffle_card id="123"]
[raffle_card id="latest"]
[raffle_card id="active"]
Notes:
latestshows the most recently published raffle.activeshows the first currently active raffle.- If
idis omitted and the shortcode is inside a WooCommerce product loop, it auto-detects the current product.
[raffle_cards]
Displays multiple raffle cards in a responsive grid layout. Supports filtering by IDs, category, and status.
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
ids | Comma-separated IDs | - | Specific raffle IDs to show |
category | Category slug(s) | - | Filter by product category |
status | active, ended, all | active | Filter by raffle status |
limit | 1–50 | 6 | Maximum cards to display |
columns | 1–4 | 3 | Number of grid columns |
orderby | date, price, title, random | date | Sort order |
order | ASC, DESC | DESC | Sort direction |
Examples
[raffle_cards status="active" limit="6" columns="3"]
[raffle_cards ids="123,456,789"]
[raffle_cards category="prizes" limit="4" columns="2"]
[raffle_cards status="all" orderby="random" limit="3"]
[raffle_cards status="ended" orderby="date" order="DESC"]
Notes:
- When
idsis provided, category and status filters are ignored. - If no matching raffles are found, a "No raffles found." message is displayed.
[raffle_countdown]
Displays a countdown timer for a specific raffle.
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
id | Product ID, latest, active | Auto-detect | Which raffle |
format | compact, full | compact | Timer style |
Examples
[raffle_countdown id="123"]
[raffle_countdown id="active" format="full"]
[raffle_countdown id="latest" format="compact"]
Formats:
- compact: Inline badge showing remaining time (e.g., "2d 14h left").
- full: Detailed countdown with days, hours, minutes, and seconds.
[raffle_progress]
Displays a ticket sales progress bar showing tickets sold vs. available.
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
id | Product ID, latest, active | Auto-detect | Which raffle |
Example
[raffle_progress id="123"]
Note: Only displays meaningful data when the raffle has a maximum ticket limit set.
[raffle_prize]
Displays prize information for a raffle, including all prize tiers when multiple winners are configured.
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
id | Product ID, latest, active | Auto-detect | Which raffle |
Example
[raffle_prize id="123"]
[raffle_status]
Displays a status badge for a raffle.
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
id | Product ID, latest, active | Auto-detect | Which raffle |
Example
[raffle_status id="123"]
Status labels
| Raffle State | Badge Label |
|---|---|
| Not yet started | Coming Soon |
| Currently active | Active |
| All tickets sold | Sold Out |
| Past end date | Ended |
| Winner drawn | Winner Selected |
Use cases
Landing pages
Create a dedicated raffle page with:
<h2>Current Raffle</h2>
[raffle_card id="active"]
<h2>All Our Raffles</h2>
[raffle_cards status="all" columns="3" limit="9"]
Sidebar widgets
Add a compact countdown to your sidebar:
[raffle_countdown id="active" format="compact"]
[raffle_status id="active"]
Blog posts
Embed a specific raffle in a blog post:
Check out our latest raffle:
[raffle_card id="123"]
Homepage promotion
Feature active raffles on your homepage:
[raffle_cards status="active" limit="3" columns="3"]
Styling
All shortcodes use the plugin's built-in CSS classes prefixed with rfwc-. The cards and elements inherit your theme's styling and are fully responsive.
CSS classes
| Element | CSS Class |
|---|---|
| Card container | .rfwc-card |
| Cards grid | .rfwc-cards-grid |
| Card image | .rfwc-card-image |
| Card title | .rfwc-card-title |
| Card price | .rfwc-card-price |
| Card prize | .rfwc-card-prize |
| Card button | .rfwc-card-button |
Tips
- Use
activekeyword instead of hardcoding IDs; it automatically shows the current raffle. - Combine shortcodes for rich pages (card + progress + prize).
- Keep grids responsive: use 2-3 columns for best mobile experience.
- Cache-friendly: shortcode output updates on each page load.