Description
This shortcode will render a specific scratch card set that your users can purchase and scratch. If you wish to render more than one set consider using the mycred_all_scratch_cards shortcode instead.
Shortcode Attributes
Attribute | Type | Required | Default | Description |
---|---|---|---|---|
user_id |
int | No | current | Option to filter purchase history based on user. By default it will show purchases made by the current user viewing the shortcode. |
set |
int | Yes | - | The Card Set ID to run in this shortcode. |
theme |
string | No | gold | Color theme to use. Available values are: plain, inverse, blue, green, gold, red and purple |
show_balance |
int | No | 1 | Option to show a users current balance in the play field. Use 1 to show or zero to hide. |
bgcolor |
string | No | #f1f1f1 | Play field background color. |
CSS Styling
// Playfield wrapper .mycred-scratch-card-playfield { } // Card Box .mycred-scratch-card-playfield > div { } // Notice when a card is purchased or no win .mycred-scratch-card-playfield > .scratch-notice { } // Notice when a card win .mycred-scratch-card-playfield > .scratch-notice div { } // Card Set Logo (if used) .mycred-scratch-card-playfield > div img { }
Examples
Example 1: Show play field for card set with the ID of 1. Use default sizes and colors.
[mycred_scratch_cards set=1]
Example 2: Show the play field for card set with the ID of 2 and use a black background.
[mycred_scratch_cards set=2 bgcolor="black"]