1. Home
  2. Docs
  3. General
  4. Shortcodes

Shortcodes

You can use shortcodes to display a giveaway, leaderboard or winners of a giveaway.

We have this shortcodes:

Giveaway

To use the shortcode [giveaway] you will need to provide the ID of the giveaway as the attribute id. Other attributes are optional, and in the following table you can see all the available attributes.

AttributeDescription
idThe Giveaway ID. Required.
descriptionShort description to show in the giveaway.
titleShow title or not. Default: 1.
Options: 1 or 0.
redirectWhere should the subscriber be redirected after a successful signup. Default: self.
Options:
– self – Redirect to the same page
– giveaway – Redirect to the giveaway landing page
– any url – if a url is set, it will be used to redirect (example: https://wpsimplegiveaways.com)
imagesShow images added to the Giveaway or not. Default: 0.
If 1, it will show, 0 will hide it.
use_linkLink the title to the main giveaway landing page. Default: 1. If 0, it won’t.
prizesShow all the defined prizes. Default: 1. If 0, it won’t show them.
show_formShow the form. Default: 1. If 0, it won’t show the form or actions.
only_formShow only the form and actions. Default: 0. If 1, it will show only the form and actions.
show_total_entriesIf set to 1, it will show the total entries in the header.
show_entriesIf set to 1, it will show your current entries in the header.
countdown_in_headerIf set to 1, it will show a shortened countdown in the header.
hide_winners_numberIf set to 1, it will hide the number of winners in the header.
hide_prize_valueIf set to 1, it will hide the prize value in the header.
hide_prize_titleIf set to 1, it will hide the prize title in the header.
contentIf set to 1, it will show the whole content of the Giveaway.

Here is how the shortcode header will look if you hide the previous data and you show entries and countdown.

Giveaway Leaderboard

This shortcode can be used to show who is in the top with their entries. Each list is saved in cache for 12 hours. If you want to refresh it before the 12 hours, go to the giveaway for which you are showing the leaderboard and just click “Update”.

AttributeDescription
idThe Giveaway ID. Required.
limitHow much subscribers will we show. Default: 10.
orderHow are we order the entries. Default: DESC. If ASC, it will show lower first.
orderbyBy which columns are we going to order it. Default: entries.
Options: entries, email, id, status,
columnsWhich columns to show. If column entered is not in the table, it will try to get it from the meta data. Default: entries,email.

Use field keys from the Form to get other data displayed.

No spaces allowed.
headersThe headers for the columns. Default: Entries,Email

No spaces allowed.

Example:

Leaderboard where we want to show Entries, Email and Name (Name is saved as field key user_name).

[giveaway_leaderboard id=49 columns=entries,email,user_name headers=Entries,Email,Name ]

Was this article helpful to you? Yes No

How can we help?